<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#330033" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 4/25/2013 7:49 PM, Nick Coghlan
wrote:<br>
</div>
<blockquote
cite="mid:CADiSq7e-uOs4sBiZD2BKjWS+YpuHia5Hg1fuiH_F9MQ_Up=Nuw@mail.gmail.com"
type="cite">
<pre wrap="">On Fri, Apr 26, 2013 at 12:38 PM, Guido van Rossum <a class="moz-txt-link-rfc2396E" href="mailto:guido@python.org"><guido@python.org></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">If the above syntax won't work, that isinstance() outcome isn't really
important. :-(
Can't we do some kind of callable check? There may be some weird
decorators that won't work, but they aren't likely to be useful in
this context.
</pre>
</blockquote>
<pre wrap="">
Yeah, it may not be as tricky as I feared: adding "not
callable(attr_val)" to the conditions for deciding whether or not to
convert a class attribute to an instance of the enum would likely
suffice to address the method problem.
You couldn't create an enum of callables, but that would be a
seriously weird thing to do anyway....
</pre>
</blockquote>
<br>
But aren't all classes callable? But you are referring to the
initial values of the items, but still, why should those be
restricted from being any general object? Not being _functions_ is
probably OK, but I'm not sure how strong the distinction is between
functions and classes, regarding being callable...<br>
<br>
So objects are only callable if the class contains a def __call__,
but still, that seems quite restrictive.<br>
</body>
</html>