Comments (5)
This looks like a bug in pypy: it doesn't properly support __mro_entries__
.
% python3.8
Python 3.8.16 (default, Dec 26 2022, 20:36:56)
[Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> def f(): pass
...
>>> f.__mro_entries__ = lambda _: (int,)
>>> class x(f): pass
...
>>> x.__bases__
(<class 'int'>,)
>>>
% ~/.pyenv/versions/pypy3.8-7.3.11/bin/python
Python 3.8.16 (a9dbdca6fc3286b0addd2240f11d97d8e8de187a, Dec 29 2022, 11:45:30)
[PyPy 7.3.11 with GCC Apple LLVM 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>> def f(): pass
>>>> f.__mro_entries__ = lambda _: (int,)
>>>> class x(f): pass
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: metaclass found to be 'function', but calling <class 'function'> with args ('x', (<function f at 0x0000000148314ca0>,), ...) raised "'internal-code' object expected, got 'str' instead"
Meanwhile, on pypy3.9-7.3.11 this works fine. I reported https://foss.heptapod.net/pypy/pypy/-/issues/3958.
As a workaround, we could go back to the previous implementation of TypedDict on pypy3.7/8 and cut a bugfix release.
from typing_extensions.
Ah, looks like even PyPy-3.8 is broken: https://github.com/python/typing_extensions/actions/runs/5421296757/jobs/9856554127
from typing_extensions.
Hi, I've encountered this too! Only on pypy 3.7 here cause turns out pylint subclasses typing_extensions.TypedDict
when python version <3.8! https://github.com/python-trio/trio/actions/runs/5405876855/jobs/9822036832#step:5:1587 (I'm going to pin typing_extensions
to below the current version just until we get out our final release that supports 3.7, so this isn't a major problem for us.)
from typing_extensions.
As a workaround, we could go back to the previous implementation of TypedDict on pypy3.7/8 and cut a bugfix release.
If it was just broken on PyPy-3.7, I wouldn't worry about it, but since this also breaks PyPy-3.8, I think this might be a good idea as a stopgap solution, even though I definitely feel like the bug is on PyPy's side ://
from typing_extensions.
#262 is a compatibility shim that isn't too invasive for us, and fixes tests on PyPy <3.9
from typing_extensions.
Related Issues (20)
- Third-party tests failed on Thu Nov 30 2023 HOT 1
- Annotated/get_type_hints interaction in python <3.11 HOT 3
- Third-party tests failed on Fri Dec 08 2023 HOT 1
- PEP 585 + PEP 604 support HOT 11
- Hints for using typing_extensions with mypy HOT 7
- Third-party tests failed on Sat Dec 30 2023
- isinstance return different result with sys.setprofile HOT 4
- Third-party tests failed on Fri Jan 12 2024 HOT 1
- Third-party tests failed on Sat Jan 13 2024 HOT 2
- TypeError: Parameter list cannot be empty for TypeVarTuple
- Daily tests failed on Sat Jan 20 2024 HOT 2
- Third-party tests failed on Sun Jan 21 2024 HOT 1
- Unit tests fails with Python 3.13.0a2 HOT 2
- Different results in Python 3.12.1 vs Python 3.12.2 HOT 3
- Third-party tests failed on Fri Feb 16 2024 HOT 1
- Release 4.10.0 planning HOT 2
- Third-party tests failed on Sat Feb 17 2024 HOT 1
- Third-party tests failed on Sun Feb 18 2024 HOT 2
- Documentation does not work with intersphinx (missing module name) HOT 3
- Third-party tests failed on Fri Feb 23 2024 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typing_extensions.