can someone explain?

Rene Pijlman at de.nieuwsgroep
Mon Feb 17 17:48:41 CET 2003

>I'm interested in Python and I've been reading some tutorials,
>documents, etc. but could't find an answer for a few questions.

I think you should evaluate your search strategies :-)

>How can I pass an address (reference) of a variable to a function?

This is a FAQ.

>Why doesn't python let encapsulate attributes in classes? 

It does, to an extent. This is explained in the tutorial.

>def f(a,L=[]):
>  L.append(a)
>  return L
>L is a default argument so every time when a function f is invoked, L
>should be created and as a result f should return a list with only one
>Why doesn't it work that way?

This is a FAQ.

>I'm really disapointed that the same logic from C++ or Java doesn't 
>exist in Python.

If Python would be the same as C++ or Java, it would be C++ or
Java, instead of Python.

René Pijlman

Wat wil jij leren?

More information about the Python-list mailing list