Hacker News new | past | comments | ask | show | jobs | submit | ericvsmith's comments login

And for a similar idea in Python see https://peps.python.org/pep-0750/


I think you're saying that it takes fewer characters to define a namedtuple. If you're interested in less typing, There's also dataclasses.make_dataclass:

   >>> Point = dataclasses.make_dataclass("Point", ["x", "y", "z"])
   >>> Point(1, 2, 3)
   Point(x=1, y=2, z=3)


This is incorrect. The returned integer is a regular Python object, not some "unboxed" integer value.


What you're seeing here is an optimization about integers, not about pass by value. CPython only does this for small integers:

  $ python -c "print(int('3') is int('3'))"
  True
  $ python -c "print(int('300') is int('300'))"
  False
Other implementations make different choices.


I’ve worked at places where subverting firewall rules like this would get you fired. I now refer to such situations where I’m forced to twiddle my thumbs while no work gets done as “letting the process work”.


I always kick this kind of decision upwards: we can do it this way and break this rule, so I need director level approval, or we can wait until the customer blinks.


Yes. Ask your boss for approval and tell them otherwise nothing will get done.


This is spelled out in the PEP (I’m the author). There isn’t one “portion” (a term defined in the PEP) to own that file. And it’s also not a requirement that all portions be installed in the same directory. I’m sorry you feel this was lazy, it was a lot of work spanning multiple attempts over multiple years.


I appreciate your work on pep 420; I’ve benefited from it personally as a Python user. Thank you for a job well done.


Thank you for the kind words.


JavaScript tooling requires index files for everything, which makes development slow, particularly when you want to iterate fast or create many files with single output.

I think it makes sense to make the compiler or script loader to rely on just the file and their contents. Either way you're already defining everything, why create an additional redundant set of definitions.


> JavaScript tooling requires index files for everything

This just isn't true. I've never encountered tooling that forces you to have these by default. If it's enforced, it's rules defined in your project or some unusual tools


What do you mean by index files? It might depend on the bundler, but I haven’t heard of index.js/index.ts files being a hard requirement for a directory to be traversable in most tooling.


> JavaScript tooling requires index files for everything

You mean barrel files? Those are horrible kludges used by lazy people to pretend they're hiding implementation details, generate arbitrary accidental circular imports, and end up causing absolute hell if you're using any sort of naive transpiling/bundling tooling/plugin/adapter.


For managing config files I use yadm https://yadm.io/, which I learned of on HN.

Among other great features, it lets me tailor settings per OS (Windows, Mac, Linux) and per client. And my settings are all in git, so they’re easy to save and copy around, and they’re all in one place, not dependent on each tool to know how to save their settings on some server.


Have you used Chezmoi (https://chezmoi.io) before? I've been using that for a few years now; I'd be curious to understand how YADM compares.


I have not used chezmoi, thanks for the pointer. From the comparison chart it looks similar to yadm. It looks like go vs. bash is the biggest difference. It’s occasionally handy to debug yadm’s bash script, although it’s been years since I had to do so. I’ll take a deeper look.


A major reason I stick with yadm, aside from that it works great and offers me no trouble, is that for basic usage I can just reuse my existing familiarity with the git interface, replacing "git" with "yadm" in the command.


See my comment and the linked email at https://github.com/ericvsmith/dataclasses?tab=readme-ov-file... for dataclasses and 3.6. I think it's still true.


The reason Guido didn't want 3.6 to guarantee dict ordering was to protect 3.5 projects from mysteriously failing when using code that implicitly relied on 3.6 behaviors (for example, cutting and pasting a snippet from StackOverflow).

He thought that one cycle of "no ordering assumptions" would give a smoother transition. All 3.6 implementations would have dict ordering, but it was safer to not have people rely on it right away.


That’s not actually true. While dataclasses to most of its inspiration from attrs, there are many features of attrs that were deliberately not implemented in dataclasses, just so it could “fit” in the stdlib.

Or maybe you mean the backport of dataclasses to 3.6 that is available on PyPI? That actually came after dataclasses was added to 3.7.

Source: I wrote dataclasses.


> I wrote dataclasses.

Much appreciated!


Thank you for correcting me! I must be thinking of another library


I like to think of it like mad cow: that’s what you get when you feed animals to animals. Same with AI.


Not trying to make a point but just throwing another layer in the game.

There is a tribe with a long history of ritual cannibalism that has developed a genetic modification(mutation) that prevents them from getting this disease.


Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: