[Tutor] function local var problem :-((
mjekl at clix.pt
mjekl at clix.pt
Sun Oct 5 18:16:20 EDT 2003
Hi Gregor,
I was just in the process of writting an apologie mail.
I confused function def with function call, so I tested (the wrong
statement):
def printHierarchy(objecto, []): # this is wrong
And you where talking about the call:
>>> printHierarchy(oSub2, []) # this is right
I'm sorry for making this mistake.
Sincerely,
Miguel
>
> mjekl at clix.pt schrieb:
>
> >...
> >Hi Gregor,
> >
> >Your right about everything, except that:
> >
> >
> >
> >>>>printHierarchy(oSub2, []) # is a sintax error
> >>>>
> >>>>
> >
> >Best Regards,
> >Miguel
> >
> >
> Hello Miguel?
> When I wrote
>
> >>Remark: As far as I see you could solve your problem
> >>by deleting the defaultargument in the definition
> >>
> I meant that you could write
>
> def printHierarchy(objecto, printList):
> """Prints a class hierarchy given an object.
> Works only with single inheritance hierarchies."""
> ...
>
> deleting the default argument for the second parameter but keeping the
> parameter itself.
> What is wrong the with
>
> >>and then
> >>call
> >>
> >> >>> printHierarchy(oSub2, [])
> >>
> Regards, Gregor
>
>
Clix Rapidix - Aumente até 6X a velocidade da sua Internet
Adira em http://acesso.clix.pt e comece logo a navegar
More information about the Tutor
mailing list