[triangle-zpug] static list in python

Josh Johnson josh_johnson at unc.edu
Fri Mar 14 16:39:17 UTC 2008


I guess a global isn't so bad, it's only really global to your package. 
There has to be some definitive answer. You might want to pose your 
question to the python tutor mailing list.

JJ

Joseph Mack NA3T wrote:
> On Fri, 14 Mar 2008, Josh Johnson wrote:
>
>> I recall two meanings for static in programming. Static can mean a
>> persistent value, like an internal counter in a list (I think that's
>> what you want),
>
> yes
>
>> but I've also heard the term mean "a class method that
>> is accessed like a library instead of an instance method".
>
> sorry, forgot about this (I guess "static" is overloaded).
>
>> I'm not sure if python supports the sort of persistent variable I think
>> you want (anybody else know?). If not, you may have to start with a list
>> and have that list be returned by your function and then subsequently
>> passed to it again:
>
> This doesn't seem a whole lot different to just having l being global, 
> which is what I'm doing for the moment.
>
> Thanks Joe
>




More information about the triangle-zpug mailing list