The Artima Developer Community
Sponsored Link

Python Buzz Forum
Message to Self. What's this?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Thomas Guest

Posts: 236
Nickname: tag
Registered: Nov, 2004

Thomas Guest likes dynamic languages.
Message to Self. What's this? Posted: Aug 12, 2006 10:14 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Thomas Guest.
Original Post: Message to Self. What's this?
Feed Title: Word Aligned: Category Python
Feed URL: http://feeds.feedburner.com/WordAlignedCategoryPython
Feed Description: Dynamic languages in general. Python in particular. The adventures of a space sensitive programmer.
Latest Python Buzz Posts
Latest Python Buzz Posts by Thomas Guest
Latest Posts From Word Aligned: Category Python

Advertisement

Where C++ has this, Python has self.

Unlike C++’s this you’re not required to refer to the current object as self: you could call it me, or current_object, or even this – but you’d have to be feeling pretty perverse to adopt such a non-idiomatic style. And also unlike C++, you do have to explicitly name the current object, which some find tiresome.

Python does have a standard this library, though. It isn’t documented. It isn’t even tested. To see what it does, open a command shell and type:

python -c "import this"

Go on, try it!

Read: Message to Self. What's this?

Topic: A Subversion Pre-Commit Hook Previous Topic   Next Topic Topic: It Lives, Igor!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use