[Tutor] class methods as static methods?

Alex Hall mehgcap at gmail.com
Sun May 30 03:50:22 CEST 2010


On 5/29/10, Mark Lawrence <breamoreboy at yahoo.co.uk> 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
>> 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.
I have built one app in Python and have experience in Java and
Javascript, as well as some in PHP; in fact, I am going into my fourth
year of college for a computer science degree in September. While they
have not done as much programming as I would like, I have had enough
that I can find the commonalities between languages and generally know
what I am looking for (make this public, turn that into a class
instead of an independent collection of vars...)
That said, I have no professional experience programming and do only
assigned problems and hobby-level programming. My Screenless Widgets
app is nearing beta testing and works to my satisfaction, but I am
sure there is much I could do to improve it. Still, everyone has to
start somewhere...
I say all this not to express any offense at your message - believe
me, none taken - but rather to tell everyone just where I am coming
from.
>
> For a really great introduction to Python, I suggest diveintopython,
> it's what got me going eight years ago.
I feel that I understand the basics; what I am running into are things
that crop up and I learn them as needed; if I learn a concept but then
never use it, I will forget it, or mix it up with a similar comcept in
another language, so I generally attack things by reading intro
tutorials, modifying them, and then continuing from there until I feel
that I can start my own project from scratch and figure out the pieces
as I go along.
>
> Kindest regards.
>
> Mark Lawrence.
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>


-- 
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