[Python-Dev] PEP 362 Third Revision (original) (raw)
Victor Stinner victor.stinner at gmail.com
Fri Jun 15 08:37:40 CEST 2012
- Previous message: [Python-Dev] PEP 362 Third Revision
- Next message: [Python-Dev] PEP 362 Third Revision
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I don't understand what the purpose of isimplemented is, or how it is supposed to be computed. It's computed based on locally available functionality. Its purpose is to allow LBYL when using functionality that may not be available on all platforms. See issue 14626 for a specific use-case--which is why I pushed for this. When all the chips fall into place, I expect to have some code that looks like this: os.chown.signature.parameters['fd'].isimplemented = sysconfig.getconfigvar('HAVEFCHOWN')
(Do you mean "fd" or "dirfd"?)
I don't like such function, how can it be portable? How do you decide in your program if you can use it on any platform or not? I prefer to have a clear distinction between chown() et fchown() for example. So you can simply test hasattr(os, "fchown") and decide what to do if the function is not supported.
How do you decide if the parameter is supported or not? For example, some platforms may not support all available values for a parameter. Dummy example, maybe not the best one: clocks supported by time.clock_gettime() heavily depends on the platform.
Victor
- Previous message: [Python-Dev] PEP 362 Third Revision
- Next message: [Python-Dev] PEP 362 Third Revision
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]