Message292926
The classes mentioned actually require that the path exist on the file system so there's no extra restrictions. As for cost, it's pretty cheap as a call to _os.fspath() is written in C and does an immediate type-check for str or bytes for the common-case (https://github.com/python/cpython/blob/master/Modules/posixmodule.c#L12099). These classes are also instantiated once typically and then cached so the cost is only paid once per object.
As for use-cases, I've seen people directly instantiate these classes in user code and so supporting paths in a universal way like the rest of the stdlib would be good for consistency. |
|
Date |
User |
Action |
Args |
2017-05-03 16:50:19 | brett.cannon | set | recipients:
+ brett.cannon, ncoghlan, eric.snow, serhiy.storchaka, louielu |
2017-05-03 16:50:19 | brett.cannon | set | messageid: <1493830219.51.0.00925181487557.issue30247@psf.upfronthosting.co.za> |
2017-05-03 16:50:19 | brett.cannon | link | issue30247 messages |
2017-05-03 16:50:19 | brett.cannon | create | |
|