noob question: "TypeError" wrong number of args
bruno at modulix
onurb at xiludom.gro
Thu May 4 10:45:11 CEST 2006
Ben Finney wrote:
> Bruno Desthuilliers <bdesth.quelquechose at free.quelquepart.fr> writes:
>>Ben Finney a écrit :
>>>So now you're proposing that this be a special case when a
>>>function is declared by that particular syntax, and it should be
>>>different to when a function is created outside the class
>>>definition and added as a method to the object at run-time.
>>>Thus breaking not only "explicit is better than implicit",
>>This one can be subject to discussion.
> All the assertions in 'import this' are subject to discussion.
Of course - but that was not the point. I meant that having implicit
self in methods would not break this assertion much more than the
current strange mix of explicit declaration of self + implicit passing
> even contradictory.
That's the nature of Zen, isn't it ?-)
>>I'm not yet ready to vote for Edward's proposition - as you say, it
>>makes 'def statements into a class statement' a special case, and I
>>don't like special cases too much (OTOH, there actually *are*
>>special cases - __new__() being an example) - *but* it's not that
>>silly either IMHO, and I think this should not be dismissed on a
>>purely reactional basis.
> My basis for rejecting the proposal is that it claims to offer net
> simplicity, yet it breaks at least two of the admonishments that
> simplify Python.
One could also claim that the current scheme *actually* breaks
explicit-implicit and special-case rules in that the instance is
implicitely passed at call time for the bound methods special case -
which is ok IMHO since practicallity-beats-purity. Also, FWIW, Edward's
proposition can be justified (at least that's Edward's POV) by the first
rule : beautiful is better than ugly !-)
disclaimer : None of this is to be taken as the expression of my own
position on this proposition...
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"
More information about the Python-list