Message282246
This step here is likely to be causing you problems:
https://github.com/django/django/blob/6d1394182d8c4c02598e0cf47f42a5e86706411f/django/db/models/base.py#L90
Because the original class namespace isn't being passed up to type.__new__, it isn't seeing the `__classcell__` reference it needs in order to populate the automatic reference correctly. Copying that over the same way you're already copying `__module__` should get things working again with 3.6.0b4.
However, given that we have a least one in-the-wild example of this causing problems, I think the right thing to do on the CPython side is to restore the old behaviour where the cell reference is returned from the class creation closure, but issue a deprecation warning if it hasn't already been set by type.__new__.
We're also going to need to document `__classcell__`, as we didn't account for the type-subclass-passing-a-different-namespace-to-the-parent-method scenario when initially deciding we could treat it as a hidden implementation detail. |
|
Date |
User |
Action |
Args |
2016-12-02 15:46:44 | ncoghlan | set | recipients:
+ ncoghlan, gvanrossum, larry, ned.deily, python-dev, eric.snow, Martin.Teichmann, Tim.Graham |
2016-12-02 15:46:44 | ncoghlan | set | messageid: <1480693604.39.0.260860774044.issue23722@psf.upfronthosting.co.za> |
2016-12-02 15:46:44 | ncoghlan | link | issue23722 messages |
2016-12-02 15:46:44 | ncoghlan | create | |
|