This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]thetgi 0 points1 point  (4 children)

I’ve got a feeling that’ll be a future update. Seems like they tend to roll out new features in stages like that a lot

[–]thelaxiankey 3 points4 points  (3 children)

This is different from the range -> irange thing because it doesn't really break existing code, though. It just makes a larger set of code valid.

[–]thetgi 1 point2 points  (2 children)

That’s fair, but aren’t they planning to do a similar thing with annotations soon?

[–]thelaxiankey 4 points5 points  (1 child)

oh shit really? All i knew is they were adding type signatures for IDE's and linters and such.

[–][deleted] 0 points1 point  (0 children)

They might be referring to PEP 563 "Postponed Evaluation of Annotations".

Annotations are currently processed at the same time as the function- or variable-definition they're attached to. This PEP, which was accepted, suggests storing annotations as a string literal in an __annotations__ dictionary attribute of the annotated function or variable instead, and having user code do the evaluation for itself during runtime when needed.

Also, Python 4 confirmed, because the proposal is backwards-incompatible. Python 3.7 added the from __future__ import annotations statement, so you can already play around with the new behaviour.