noob question: "TypeError" wrong number of args
bruno at modulix
onurb at xiludom.gro
Thu May 4 04:48:52 EDT 2006
Edward Elliott wrote:
> Ben Finney wrote:
>
>>As I understand it, the point was not what the code does, but to give
>>a sample input (a Python program) for the "simple text processor" you
>>described to wade through.
>
>
> Ah, well then, there's no need for a full-blown parser. It should suffice
> to recognize a class definition and modify the parameter list of every def
> indented one level further than that.
won't do :
class CounterExample(object):
if compute_some_const_according_to_phase_of_moon():
def meth(...):
do_something(self, 42)
else:
do_something_else(self)
> Then pick out the static methods and
> 'undo' those.
don't forget classmethods...
--
bruno desthuilliers
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
mailing list