Python style question

Aaron Bentley aaron.bentley at utoronto.ca
Mon Jun 6 14:03:54 BST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:

| One way is a simple function, as here.  Another way is a static method
| like Branch.open().  I suppose one might also override the call method
| for Branch so that it possibly constructs a subclass(?)

I've only been using python for a year, but my understanding is that
class method != static method.

http://naeblis.cx/rtomayko/2004/12/15/the-static-method-thing
http://dirtsimple.org/2004/12/python-is-not-java.html

Personally, I prefer using a function, which is what I do in C++, too.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCpEm50F+nu1YWqI0RAh7IAJ9uYQ1Hg2S1yG4J/XRao4PeJJuHlACfUGz8
nhkv1ZevYXCo+om5Qmvg2Js=
=UME1
-----END PGP SIGNATURE-----




More information about the bazaar mailing list