Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 2nd, 2003, 10:15 PM
Sexy_Road_kill Sexy_Road_kill is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 16 Sexy_Road_kill User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Newbie questoins :/

ok
i'm reading this code
pykanoid game
there is alot of
self. ......
there are classes too
how does the self thing work in so many classes :/

Reply With Quote
  #2  
Old September 3rd, 2003, 06:36 AM
percivall percivall is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 133 percivall User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
'self' is just an explicit reference to the object in which 'self' is bound.

Every member method in Python must include in its list of parameters as first formal parameter a name to which Python will bind a reference to the object. You could use the name 'this' or 'lolita' or any valid name, but by consensus, and by the word of GvR, the name 'self' is most often used.

'self' is just like 'this' in Java, except for the fact that you explicitly include it as first of your formal parameters in any member method, whereas in Java, the parameter is there, and the reference is passed, but everything is implicit.

For more information, look at Chapter 9. Classes in the Python Tutorial, or, for a more terse explanation, you could look at §4.21 What is self? in the Python FAQ.

Last edited by percivall : September 3rd, 2003 at 06:41 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Newbie questoins :/


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway