question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] PEP 604 Support

See original GitHub issue

Hi @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 dataclasses. 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:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
TeamSpen210commented, Nov 18, 2021

Well, latest news is that the Steering Council has deferred accepting either of those PEPs, and are requesting more input from all stakeholders.

1reaction
leyceccommented, Dec 3, 2021

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. 🌩️

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found