[Feature Request] PEP 604 Support
See original GitHub issueHi @leycec , thanks for a great library!
Upon discovered of this decorator, I thought I’d give beartype
a run in my codebase – I am a heavy user of dataclass
es. And, of course, a heavy user of runtime-checks!
After the proof-of-concept work, everything still works. But I did notice:
- the
from future import __annotations__
had to be removed (I’m a 3.9 user). Is this required by your users? - the initial performance was poorer – I’d continue to move the handcrafted runtime checks into
Is[]
. I’d report back later on this.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
PEP 604 Support · Issue #348 · tiangolo/typer - GitHub
I'm thinking if you can do this output: Path = None ? When you have Path | None , the function expects either...
Read more >Support PEP 604 -- Allow writing union types as X | Y
Support PEP 604 -- Allow writing union types as X | Y ; Project, PyCharm ; Priority, Normal N ; Type, Feature ;...
Read more >What's New In Python 3.10 — Python 3.11.1 documentation
Interpreter improvements: PEP 626, Precise line numbers for debugging and other tools. New typing features: PEP 604, Allow writing union types as X...
Read more >Support | pytype - Google
This page lists the Python versions and features supported by the latest version of pytype. ... PEP 604 – Allow Writing Union Types...
Read more >Annotation issues at runtime - mypy 0.991 documentation
Starting with Python 3.10 (PEP 604), you can spell union types as x: int | str , instead of x: typing.Union[int, str] ....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well, latest news is that the Steering Council has deferred accepting either of those PEPs, and are requesting more input from all stakeholders.
Yo, homie! Crazy union supported just dropped. Now you too can leverage the dark power of the
|
operator to satisfy all your succinct typing needs. Wow coworkers! Wow the wifey! Wow even that twenty-year stray cat with mange you took in against your University roommate’s wishes. You showed him, didn’t you? Now, show everyone else.All this and more coming up in…
beartype 0.10.0
. Activate the thunderbolts and lightning, Zeus. 🌩️