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.

Beartype 0.10.0 broken in python 3.9.1

See original GitHub issue

Hello, I noticed that since the new update, we can no longer import beartype within python 3.9.1. This is the error I get:

>>> import beartype
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jlidin/.local/share/virtualenvs/test-beartype/lib/python3.9/site-packages/beartype/__init__.py", line 129, in <module>
    from beartype._decor.main import beartype
  File "/home/jlidin/.local/share/virtualenvs/test-beartype/lib/python3.9/site-packages/beartype/_decor/main.py", line 71, in <module>
    ) -> Union[BeartypeableT, BeartypeConfedDecorator]:
  File "/home/jlidin/.local/share/pyenv/versions/3.9.1/lib/python3.9/typing.py", line 262, in inner
    return func(*args, **kwds)
  File "/home/jlidin/.local/share/pyenv/versions/3.9.1/lib/python3.9/typing.py", line 339, in __getitem__
    return self._getitem(self, parameters)
  File "/home/jlidin/.local/share/pyenv/versions/3.9.1/lib/python3.9/typing.py", line 451, in Union
    parameters = _remove_dups_flatten(parameters)
  File "/home/jlidin/.local/share/pyenv/versions/3.9.1/lib/python3.9/typing.py", line 231, in _remove_dups_flatten
    return tuple(_deduplicate(params))
  File "/home/jlidin/.local/share/pyenv/versions/3.9.1/lib/python3.9/typing.py", line 205, in _deduplicate
    all_params = set(params)
TypeError: unhashable type: 'list'

This was tested with a clean virtual environment and only beartype installed. It did work with python 3.10.2 however. Is the new version only compatible with python 3.10?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
leyceccommented, Feb 11, 2022

With profuse apologies and a sweaty brow, I’m closing this kinda awkwardly. Python 3.9.1 is broke. No one should use broke Python. But someone is. But someone using broke Python is outside our wheelhouse.

Maybe there’s a demonstrably good reason for someone to use broke Python? If so, angrily bang on that Reopen button and we’ll tactfully revisit this. Until then, please upgrade your Python to something less visibly broke.

May the fist-bumping bear be with you always. 🤛 🐻 👍

2reactions
leyceccommented, Feb 9, 2022

…we can no longer import beartype within python 3.9.1.

ohnoes

The sky is falling and we have only this flimsy microlight wingsuit.

wtfbro

Is the new version only compatible with python 3.10?

Thank Guido, no. We still retain full backward and forward compatibility with Python 3.6.0–3.10.2. At least, we thought we did. 😬

Our GitHub Actions-hosted continuous integration (CI) workflow tends to only test on the most recently patch version of each CPython release. For the Python 3.9 release cycle, this means CPython 3.9.9. CPython 3.9.1 is rather crusty around the ears at this point and possibly a security concern.

Still, we absolutely want to support all possible CPython versions. This includes CPython 3.9.1. In this case, the CPython 3.9.1-specific implementation of the standard typing module appears to suffer critical defects with respect to PEP 448-style unions and child type hints containing lists. </sigh>

zomg

Oh, yes. This is actually a known CPython 3.9.1 issue (#42965) subsequently resolved in CPython 3.9.2. Badness erupts! Older CPython being fundamentally broken kinda makes us a bit less inclined to want to try resolve this on our end – especially as the only means of doing so seems to be revert to deprecated typing.Callable[...] type hints under Python 3.9.1. I shake my bald head.

Given that your typing implementation is critically cracked up, is there any chance you’d be willing to update to a newer CPython 3.9 release, @joelid?

I had encountered warnings having only partial stack traces (and therefore not pointing at the offending line of code) in python 3.9.7…

That… also doesn’t sound good. When you get a spare moment, please drop us a traceback bomb and we’ll guillotine that bug with aplomb. 🪦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unbearably fast near-real-time runtime type-checking ... - GitHub
Beartype is an open-source PEP-compliant near-real-time pure-Python runtime type checker emphasizing ... Of course, their code was probably always broke.
Read more >
beartype - PyPI
Beartype is an open-source pure-Python runtime type checker emphasizing efficiency, portability, and thrilling puns.
Read more >
beartype: Documentation - Openbase
Beartype is portably implemented <beartype codebase_> in Python 3 <Python_> ... pretty sure we just broke the world from collections.abc import Sequence ...
Read more >
Issue 42965: Optional callable raises TypeError - Python tracker
It has already been fixed on Python 3.10, and on Python 3.9.2 (which isn't out ... Callable, then update it in newer versions...
Read more >
Compare Packages Between Distributions - DistroWatch.com
Complete summaries of the Gentoo Linux and Fedora projects are available. Note: In case where multiple versions of a package are shipped with...
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