[Tutor] class methods as static methods?

Mark Lawrence breamoreboy at yahoo.co.uk
Sun May 30 05:08:29 CEST 2010


Hi Alex, thanks for the response, please see below.

On 30/05/2010 02:50, Alex Hall wrote:
> 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.

I should hope not, I used to be big-headed, but now I'm perfect :)

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

I suggest that you do *NOT* understand the basics, at least wrt Python, 
otherwise you would not have placed your original queries on c.l.py, 
before being asked to move to this ng/ml.  Regardless of that, you're on 
*THE* finest group of mls/ngs going for getting very sound advice from 
some of the most highly respected guys/gals going.  And if you want some 
kind of feeling of industry experiences, subscribe to the Python 
bugs/development/ideas ngs/mls (if you haven't already done so) and 
you'll very rapidly get an idea of just how difficult software 
development can get.

As an example, look for the thread on comp.lang.python within the last 
24 hours from myself subject "xrange issue 7721".  A relatively simple 
thing you'd have thought, but read the background on the Python bug 
tracker, and you'll see it ain't quite that easy.

But then, what do I know, I've only 34 years industry experience, albeit 
slightly tempered over the last nine years by physical and mental ill 
health.

>>
>> Kindest regards.
>>
>> Mark Lawrence.
>>
>> _______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> To unsubscribe or change subscription options:
>> http://mail.python.org/mailman/listinfo/tutor
>>
>
>

I'm now going to bed, as it's 04:08 BST and I'm absolutely shattered.

Kindest regards.

Mark Lawrence.




More information about the Tutor mailing list