Pablo Galindo Salgado <pablog...@gmail.com> added the comment: This behaviour is because "parent" descriptor ends calling:
@classmethod def _from_parsed_parts(cls, drv, root, parts, init=True): self = object.__new__(cls) self._drv = drv self._root = root self._parts = parts if init: self._init() return self and this calls object.__new__ and this call raises AttributeError: new_attr. Notice that object.__new__(cls) will not raise as this snippet shows: >>>: class A: ...: def __new__(*args): ...: raise ZeroDivisionError() ...: >>> A() --------------------------------------------------------------------------- ZeroDivisionError Traceback (most recent call last) <python> in <module>() ----> 1 A() <python> in __new__(*args) 1 class A: 2 def __new__(*args): ----> 3 raise ZeroDivisionError() 4 ZeroDivisionError: >>> object.__new__(A) >>> <__main__.A at 0x7f6239c17860> ---------- nosy: +pablogsal _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32665> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com