Message257615
I think it's actually very reasonable for a Path to have a path attribute
that's a string. The DirEntry has two string attributes: name (the last
component) and path (the full path). The Path object already has the
former. Adding the latter makes sense to me. After all you've gotta give it
*some* name, and 'path' is used (unsurprisingly) in this meaning already in
many places.
The shortest idiom in libraries wanting to support this would be
path = gettattr(arg, 'path', arg)
This extracts the path attribute from a DirEntry or Path object, and
assumes the argument is a string otherwise. I think this is relatively
reasonable to encode in C as well. |
|
Date |
User |
Action |
Args |
2016-01-06 17:30:22 | gvanrossum | set | recipients:
+ gvanrossum, barry, brett.cannon, georg.brandl, pitrou, bronger, ezio.melotti, Arfrever, r.david.murray, daniel.ugra, cool-RR, tshepang, serhiy.storchaka |
2016-01-06 17:30:22 | gvanrossum | link | issue22570 messages |
2016-01-06 17:30:22 | gvanrossum | create | |
|