static class methods in Python?

Aahz Maruch aahz at netcom.com
Sat Feb 19 02:07:06 CET 2000


In article <slrn8arn3d.9md.neelk at brick.cswv.com>,
Neel Krishnaswami <neelk at alum.mit.edu> wrote:
>
>This is probably a stupid question, but what /is/ a class method?
>I've never programmed in C++ (or Java), so an explanation would be
>appreciated.

Class methods are used to access and modify class variables.  For
example:

class foo:
	bar = None
	def __init__(self):
		pass
	classdef isdone():
		if foo.bar is not None:
			return "!!!"
	classdef clear():
		foo.bar = None

Clearer?
--
                      --- Aahz (Copyright 2000 by aahz at netcom.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

Our society has become so fractured that the pendulum is swinging
several different directions at the same time



More information about the Python-list mailing list