You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Self-type doesn't seem to work for properties #2402
I found this when trying to use self-type for pathlib (see PR python/typeshed#658). There are a few properties that have type PurePath and are repeated in the Path subclass. The stub uses plain attributes for these, but the implementation has properties, so I want to replace them with properties. However this doesn't seem to work. In particular I'm trying to add this to class PurePath:
@gvanrossum I'm thinking you were intending to @ mention someone else. 😉 It would be my luck that, the one time I'm contacted by the creator of Python, it's by mistake.
Activity
elazar commentedon Nov 4, 2016
@gvanrossum I'm thinking you were intending to @ mention someone else. 😉 It would be my luck that, the one time I'm contacted by the creator of Python, it's by mistake.
gvanrossum commentedon Nov 4, 2016
Yup, sorry for that. :-/
elazarg commentedon Nov 5, 2016
I think it's just an overly-restrictive check. See the PR.
require subtyping instead of equivalence in selftype of properties (#…