Passing by reference

MartinRinehart at gmail.com MartinRinehart at gmail.com
Sun Dec 23 06:10:48 EST 2007



Bruno Desthuilliers wrote:
> MartinRinehart at gmail.com a �crit :
> >
> > Bruno Desthuilliers wrote:
> >
> >>...  that's definitively not
> >>something I'd store in global.
> >
> >
> > So where would you put it?
>
> You don't have to "put" functions arguments anywhere - they're already
> local vars.

Bruno, right now I've got this:

def __init__ ( self, t ):
    """ Constructor, called with array of strings. """

    self.text = t
    ...

Some other program will say:
tok = Toker( text_array )
tokens = tok.tokenize()

So how does the constructor make the array of strings available to the
tokenize() method?



More information about the Python-list mailing list