[Python-Dev] File system path PEP, part 2 (original) (raw)
Chris Angelico rosuav at gmail.com
Fri May 13 12:45:40 EDT 2016
- Previous message (by thread): [Python-Dev] File system path PEP, part 2
- Next message (by thread): [Python-Dev] File system path PEP, part 2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, May 14, 2016 at 2:34 AM, Ethan Furman <ethan at stoneleaf.us> wrote:
I would say use
type(x)._fspath_
. I'm not aware of any other dunder method that doesn't access the attribute from the type instead of the instance, and I see no point in making this one different.
reduce / reduce_ex in pickle.py is accessed with a straight-forward getattr() call. It's the ones that are called from deep within the interpreter core (eg iter) that are always looked up on the type.
ChrisA
- Previous message (by thread): [Python-Dev] File system path PEP, part 2
- Next message (by thread): [Python-Dev] File system path PEP, part 2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]