Re: [Tutor] class methods as static methods?

2010-05-30 Thread Alex Hall
On 5/30/10, Alan Gauld wrote: > "Alex Hall" wrote > >> 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? > > Others have pointed out that > a) This is possible using static

Re: [Tutor] class methods as static methods?

2010-05-30 Thread Alan Gauld
"Alex Hall" wrote 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? Others have pointed out that a) This is possible using staticmetjhod or classmetjod decorators and b) it s

Re: [Tutor] class methods as static methods?

2010-05-29 Thread Mark Lawrence
Hi Alex, thanks for the response, please see below. On 30/05/2010 02:50, Alex Hall wrote: On 5/29/10, Mark Lawrence wrote: 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 cl

Re: [Tutor] class methods as static methods?

2010-05-29 Thread Steven D'Aprano
On Sun, 30 May 2010 05:49:45 am 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 lik

Re: [Tutor] class methods as static methods?

2010-05-29 Thread Alex Hall
On 5/29/10, Mark Lawrence wrote: > 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 >>

Re: [Tutor] class methods as static methods?

2010-05-29 Thread Mark Lawrence
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 instantiat

Re: [Tutor] class methods as static methods?

2010-05-29 Thread Lie Ryan
On 05/30/10 05: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 inst

[Tutor] class methods as static methods?

2010-05-29 Thread Alex Hall
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 Harpoo