Any other Python flaws?
bokr at accessone.com
Sat Jun 16 00:59:28 CEST 2001
On Thu, 14 Jun 2001 20:26:10 -0400, "Steve Holden"
<sholden at holdenweb.com> wrote:
>Despite the fact that our Fearless Leader and BDFL has already revered
>himself once on this issue, I'd like to see strict syntactical equity
>between function definitions and class definitions, which is to say that a
>class with no superclasses should be declarable as:
> class myClass():
Why not the other way around? I.e., drop the mandatory "()"
for function defs with no args. A bare 'foo' could still
evaluate to <function foo at 007F308C> and foo() would do
what it does now.
You could consider '()'-less execution like Pascal, if you
could define a reasonable "__"-ism to condition the definition
of the function for that.
I sort of like the idea of a symbol being able to yield a string
transparently either by plain dereferencing or by having a
function produce it, without any difference in the expression.
Of course, you'd need some kind of quote function if you
wanted to bind another symbol to the function object iself.
More information about the Python-list