<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
On 06/06/2012 08:38 AM, Steven D'Aprano wrote:<br>
<blockquote cite="mid:4FCF7965.5070102@pearwood.info" type="cite">What's
the fully qualified name of the function, and why is it needed?
<br>
</blockquote>
<br>
Please see PEP 3155.<br>
<br>
<br>
<blockquote cite="mid:4FCF7965.5070102@pearwood.info" type="cite">"args"
is just a common name for the parameter, not for the kind of
parameter. *args (or *data, *whatever) is a varargs parameter, and
so the attribute should be called "is_varargs".
<br>
[...]<br>
Likewise for **kwargs (or **kw, etc.)<br>
</blockquote>
<br>
Yury will be pleased; those were his original names.&nbsp; I argued for
"is_args" and "is_kwargs".<br>
<br>
I assert that "args" and "kwargs" are not merely "common name[s] for
the parameter[s]", they are The Convention.&nbsp; Any seasoned Python
programmer examining a Signature object who sees "is_args" and
"is_kwargs" will understand immediately what they are.&nbsp; Jamming
"var" in the middle of these names does not make their meaning any
clearer--in fact I suggest it only detracts from readability.<br>
<br>
<br>
<blockquote cite="mid:4FCF7965.5070102@pearwood.info" type="cite">Is
there a use-case for is_implemented?</blockquote>
<br>
Yes, see issue
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
14626.<br>
<br>
<br>
<blockquote cite="mid:4FCF7965.5070102@pearwood.info" type="cite">What
happens when the existing function metadata and the __signature__
object disagree? <br>
<br>
Are there use-cases where we want them to disagree, or is
disagreement always a sign that something is broken? <br>
[...]<br>
"Changes to the Signature object, or to any of its data members, <br>
do not affect the function itself." <br>
<br>
which leaves the possibility that __signature__ may no longer
match the actual argument spec, for some reason. If you remove
getfullargspec, people will have to reinvent it to deal with such
cases.</blockquote>
<br>
There's no reason why they should disagree.&nbsp; The "some reason" would
be if some doorknob decided to change it--the objects are mutable,
because there's no good reason to make them immutable.<br>
<br>
We just wanted to be explicit, that information flowed from the
callable to the Signature and never the other way 'round.<br>
<br>
As for "what would happen", nothing good.&nbsp; My advice: don't change
Signature objects for no reason.<br>
<br>
<br>
<i>/arry</i><br>
</body>
</html>

AltStyle によって変換されたページ (->オリジナル) /