Python misconceptions in IBM Ruby article...

Gordon McMillan gmcm at hypernet.com
Thu Feb 17 22:31:34 EST 2000


John Farrell wrote:

> I agree that Python's OO features feel added on. Consider:
> 
>  * You have to pass self to each member function. There's no obvious
>    requirement that self need actually be the bound instance.

No, you have to code the method with an explicit self. The 
"bound" part means it doesn't have to be passed in. And you 
can't bind to something that's not an instance.

>  * Classes are not types. This strongly suggests that Python had
>    types other than 'instance' first, and when objects were added,
>    it was too late to make all types classes.
>  * In a method, fields of the bound instance need to be referenced
>    through the self parameter, because the scoping rules do not understand
>    about instance variables.

In a language where variables don't have to be declared, 
creating scoping rules that could tell the difference between an 
instance variable and a local would be a, um, challenge.

>  * Proper OO languages do not use white space to delimit blocks,
>    and use semicolons and block delimiters.

The really good ones use intention <wink>.
 
> That last one's a joke! Don't turn this into another white space thread!


- Gordon




More information about the Python-list mailing list