Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • That's a clear explanation. Thanks! But what about the other languages (like C++, for example)? Are there any difference between the methods and fields for the attribute lookup process in those languages? Commented Aug 2, 2013 at 8:52
  • Python is a dynamic language, and attributes do not need to be typed beforehand. With C++ on the other hand, the compiler nails everything down, so it makes much more sense to distinguish between data and methods. Methods are not objects in C++. Commented Aug 2, 2013 at 8:56
  • In Python 3 methods are even less special. There aren't any unbound methods any more. All functions are descriptors which create bound methods when looked up through the class (and as in Python 2, any custom callable class can add a three-line __get__ to get the same behavior, though I've never seen anyone do this). Commented Aug 2, 2013 at 10:15
  • Yup, just didn't want to go into that much excruciating detail.. Commented Aug 2, 2013 at 10:53