https://pantsbuild.org/ logo
#development
Title
# development
b

bitter-ability-32190

01/25/2023, 2:50 PM
Mostly FYI in https://github.com/pantsbuild/pants/pull/18052 Both
Target
and
Field
are switching from
frozen_after_init
to be vanilla
frozen
`dataclass`es. Non-dataclass subclasses of frozen dataclasses are not themselves frozen, but their frozen attributes are. All this means is people can now attach arbitrary values onto their instances of their subclasses. This isn't any different from other
frozen
dataclasses. I'm only noting it because I have to remove some lines from a test that tested this behavior. Again, still can't assign to any of the dataclasses fields. Also
__init__
is
final
c

curved-television-6568

01/25/2023, 2:58 PM
will this information be preserved somewhere.. it may be a good thing to not forget ? 😉
b

bitter-ability-32190

01/25/2023, 2:58 PM
🤷‍♂️ It's really more of an FYI. The only reason I thought about typing it up was because there's some code that tests this
c

curved-television-6568

01/25/2023, 2:59 PM
perhaps in the PR doing the change to the test cases (and there may be a comment in the tests or there abouts) 🤷
b

bitter-ability-32190

01/25/2023, 2:59 PM
To me, though. Attaching arbitrary values to any object is plain stupid, so it doens't need to be tested, because it's a huge footgun
I can call it out in the PR for sure
c

curved-television-6568

01/25/2023, 2:59 PM
yep, so maybe only in the PR…
thanks 🙏
b

bitter-ability-32190

01/25/2023, 3:00 PM
Oh duh, I'll switch the test to assign to the value. 😛
4 Views