[Python-Dev] PEP 362 Third Revision

Benjamin Peterson benjamin at python.org
Fri Jun 15 04:49:44 CEST 2012


2012/6/14 Larry Hastings <larry at hastings.org>:
>
> On 06/14/2012 01:53 PM, Antoine Pitrou wrote:
>
> * is_implemented : bool
>     True if the parameter is implemented for use.  Some platforms
>     implement functions but can't support specific parameters
>     (e.g. "mode" for ``os.mkdir``).  Passing in an unimplemented
>     parameter may result in the parameter being ignored,
>     or in NotImplementedError being raised.  It is intended that
>     all conditions where ``is_implemented`` may be False be
>     thoroughly documented.
>
> I don't understand what the purpose of is_implemented 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.

In that case wouldn't be nicer to have os level attribute ala
os.path.supports_unicode_filenames?

os.supports_atfunctions

is gobs nicer than

os.chown.__signature__.parameters['fd'].is_implemented

Not "implementing" all parameters (whatever exactly that means) is not
a very common case for a function, so I don't see what it needs to
pollute a signature object for every Python function.



-- 
Regards,
Benjamin


More information about the Python-Dev mailing list