<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
On 06/14/2012 01:53 PM, Antoine Pitrou wrote:<br>
<blockquote cite="mid:20120614225337.2b1fe5a9@pitrou.net"
type="cite">
<blockquote type="cite">
<pre wrap="">* 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.
</pre>
</blockquote>
<pre wrap="">
I don't understand what the purpose of is_implemented is, or how it is
supposed to be computed.</pre>
</blockquote>
<br>
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.<br>
<br>
When all the chips fall into place, I expect to have some code that
looks like this:<br>
<blockquote><tt>os.chown.__signature__.parameters['fd'].is_implemented
= sysconfig.get_config_var('HAVE_FCHOWN')</tt><br>
</blockquote>
That's oversimplified (and almost certainly not spelled correctly)
but you get the general idea. os.chown will soon sprout an "fd"
parameter, but it will only work on platforms where we have
fchown(). Using it will result in a NotImplementedError. But some
folks want to LBYL.<br>
<br>
<br>
<i>/arry</i><br>
</body>
</html>