[issue32665] pathlib.Path._from_parsed_parts should call cls.__new__(cls)

2018-01-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Antoine, is the reason of calling object.__new__(cls) in `_from_parsed_parts` that the code does not raise on creation? -- ___ Python tracker

[issue32665] pathlib.Path._from_parsed_parts should call cls.__new__(cls)

2018-01-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Sorry, the exception of object.__new__(cls) is AttributeError: _drv -- ___ Python tracker ___ _

[issue32665] pathlib.Path._from_parsed_parts should call cls.__new__(cls)

2018-01-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado 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

[issue32665] pathlib.Path._from_parsed_parts should call cls.__new__(cls)

2018-01-26 Thread qb-cea
qb-cea added the comment: Typo in the code of the previous comment: - __slots__ = ("new_attr",) + __slots__ = ("_new_attr",) -- type: -> behavior ___ Python tracker ___ _

[issue32665] pathlib.Path._from_parsed_parts should call cls.__new__(cls)

2018-01-25 Thread qb-cea
New submission from qb-cea : Hi, I tried subclassing pathlib.Path and provide it with a new attribute (basically an accessor to an extended attribute). I am rather new to the concept of __slots__ and __new__() but here is how I pictured it should look: from errno import ENODATA from os import