On 4/15/21 2:02 PM, Sebastián Ramírez wrote:
## Questions
I'm not very familiar with the internals of Python, and I'm not sure how the new syntax for
`Union`s using the vertical bar character ("pipe", "|") work.
But would PEP 649 still support things like this?:
def run(arg: int | str = 0): pass
And would it be inspectable at runtime?
As far as I can tell, absolutely PEP 649 would support this feature.
Under the covers, all PEP 649 is really doing is changing the
destination that annotation expressions get compiled to. So anything
that works in an annotation with "stock" semantics would work fine with
PEP 649 semantics too, barring the exceptions specifically listed in the
PEP (e.g. annotations defined in conditionals, walrus operator, etc).
Cheers,
//arry/
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-dev@python.org/message/RD4X7EGVTY6PIT76TWQCSWC6PLHMIL6Z/
Code of Conduct: http://python.org/psf/codeofconduct/