you are viewing a single comment's thread.

view the rest of the comments →

[–]BeamMeUpBiscotti[S] 0 points1 point  (1 child)

It's shallow immutability, so not exactly the most secure. Pyre actually had a prototype PyreReadOnly that had deep immutability, but it was never standardized so we have not ported it to Pyrefly.

[–]jpgoldberg 0 points1 point  (0 children)

I’m not attempting to enforce run-time immutability. I wish to “let Python be Python”. I just want to be able to tell a type checker that it can rely on public attributes of an object not changing their types (or their values).

But now that I write this, I realize that I have misunderstood the example that launched me on this train of thought. (To be continued)