Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
Closed
Description
After being a bit late with Python 3.13, I figured to start testing 3.14 early this time.
With Python3.14.0a1 the following fails:
# native.pyfromtypingimportAnydefdec(x:Any)->Any:returnx@decclassD:x:intclassE(D):y:int
# driver.pyfromnativeimportD,Eimportpickleassertnothasattr(D,'__mypyc_attrs__')assertE.__mypyc_attrs__== ('y','__dict__')e=E()e.x=10e.y=20asserte.__getstate__()== {'y':20,'__dict__': {'x':10}}e2=pickle.loads(pickle.dumps(e))asserteisnote2ande.x==e2.xande.y==e2.y
rm -rf buildrm *.sopython3.14 -m mypyc native.pypython3.14 -c 'import driver.py'The error message
$python-c"import driver.py"Traceback (mostrecentcalllast):File"<string>",line1,in<module>importdriver.pyFile".../driver.py",line14,in<module>asserteisnote2ande.x==e2.xande.y==e2.y^^^^AttributeError:'E'objecthasnoattribute'x'
I bisected this topython/cpython#123192 upstream.
--
This is also part of the mypyc test suite
pytest -n0 mypyc/test/test_run.py::TestRun::run-classes.test::testPickling