[issue35048] Can't reassign __class__ despite the assigned class having identical slots

2019-12-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: The relevant logic is in the compatible_for_assignment() function on line 3972 in Objects/typeobject.c. After checking that the tp_free slots are the same, it proceeds as follows: /* It's tricky to tell if two arbitrary types are sufficiently com

[issue35048] Can't reassign __class__ despite the assigned class having identical slots

2019-12-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue35048] Can't reassign __class__ despite the assigned class having identical slots

2019-12-07 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue35048] Can't reassign __class__ despite the assigned class having identical slots

2019-12-05 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue35048] Can't reassign __class__ despite the assigned class having identical slots

2019-12-05 Thread Sterling Smith
Change by Sterling Smith : -- nosy: +Sterling Smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue35048] Can't reassign __class__ despite the assigned class having identical slots

2018-10-23 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue35048] Can't reassign __class__ despite the assigned class having identical slots

2018-10-23 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి
Change by Srinivas Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) : -- nosy: +thatiparthy ___ Python tracker ___ ___ Python-bugs-li

[issue35048] Can't reassign __class__ despite the assigned class having identical slots

2018-10-23 Thread Dan Snider
New submission from Dan Snider : >>> class a(dict): __slots__ = '__dict__', 'x' >>> class b(dict): __slots__ = '__dict__', 'x' >>> self = a(); self.__class__ = b Traceback (most recent call last): File "", line 1, in self=a(); self.__class__ = b TypeError: __class__ assignment: 'b' obje