This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Antony.Lee
Recipients Antony.Lee
Date 2014-04-01.22:08:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1396390108.81.0.285327356985.issue21127@psf.upfronthosting.co.za>
In-reply-to
Content
Trying to construct a Path object from a str subclass, e.g.

class S(str): pass
Path(S("foo"))

fails because the subclass cannot be interned.  I think that the interning should simply be removed for non-exactly-str arguments (it is only here for performance reasons, right?), or at least the error should be more explicit (note, in particular, that there is no error if one tries 'Path(S("foo/bar"))' instead, which only confuses the matter more).

In practice, I found out this via numpy, which provides its own str subclass, numpy.str_.
History
Date User Action Args
2014-04-01 22:08:28Antony.Leesetrecipients: + Antony.Lee
2014-04-01 22:08:28Antony.Leesetmessageid: <1396390108.81.0.285327356985.issue21127@psf.upfronthosting.co.za>
2014-04-01 22:08:28Antony.Leelinkissue21127 messages
2014-04-01 22:08:28Antony.Leecreate