static variables
Grobu
snailcoder at retrosite.invalid
Tue Dec 1 04:15:25 EST 2015
More information about the Python-list mailing list
Tue Dec 1 04:15:25 EST 2015
- Previous message (by thread): static variables
- Next message (by thread): static variables
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Perhaps you could use a parameter's default value to implement your static variable? Like : # ------------------------------------------------- >>> def test(arg=[0]): ... print arg[0] ... arg[0] += 1 ... >>> test() 0 >>> test() 1 # -------------------------------------------------
- Previous message (by thread): static variables
- Next message (by thread): static variables
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list