[FRPythoneers] Riddle me this Batman

Eric Brunson brunson at level3.net
Mon Nov 19 21:56:00 MST 2001


I can't imagine why anyone would want that behavior with a function or
a class.  What's the rationale for it?

* Jeffery D. Collins (jcollins at boulder.net) [011119 21:27]:
> 
> Once.  You can check it out by running a simple experiment:
> 
> class T:
>       def x(self, q=[]):
> 	  self.q = q
> 	  self.q.append("x")
> 
> 
> t = T()
> t.x()
> t.x()
> print t.q
> #['x', 'x']
> 
> s = T()
> s.x()
> s.x()
> print t.q
> #['x', 'x', 'x', 'x']
> 


-- 
 Eric Brunson   brunson at level3.net   page-eric at level3.net  
tcA thgirypoC muinelliM latigiD eht detaloiv tsuj evah uoY



More information about the FRPythoneers mailing list