[Tutor] class methods as static methods?
Mark Lawrence
breamoreboy at yahoo.co.uk
Sun May 30 02:04:20 CEST 2010
On 29/05/2010 20:49, Alex Hall wrote:
> 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.
>
Hi Alex,
See you're still going for it :)
I think that you're trying to build a Yamoto/Musashi before you've built
a raft from oil drums or whatever :) If I'm wrong, I'll apologise here
and now.
For a really great introduction to Python, I suggest diveintopython,
it's what got me going eight years ago.
Kindest regards.
Mark Lawrence.
More information about the Tutor
mailing list