[Tutor] class methods as static methods?

Alex Hall mehgcap at gmail.com
Sat May 29 21:49:45 CEST 2010


Hi all,
In Battleship, I have a weapons.py file, currently with just one
missile type (a Harpoon anti-ship missile). This Harpoon class defines
a getImpactCoords method, which returns all coordinates on the map
that it will hit. I would like to not instantiate a Harpoon object,
just call the Harpoon's getImpactCoords method and pass it the
required arguments. Is this possible? Thanks. Sorry if I got the terms
backwards in the subject; I can never remember which is static and
which is non-static.

-- 
Have a great day,
Alex (msg sent from GMail website)
mehgcap at gmail.com; http://www.facebook.com/mehgcap


More information about the Tutor mailing list