Python misconceptions in IBM Ruby article...

Gaetan Corneau Gaetan_Corneau at baan.com
Fri Feb 18 11:58:58 EST 2000


> class Spam:
> 
> 	def eggs(self):
> 		self.x = 1


> class C {
> 	int i;
> 	void foo(int i) {this->i = i}
> }

The point is that you have to declare "self" as the first member argument in
Python, but not in C++. It may be a good or a bad thing for language
purists, but one thing is shure, it's a very common "gotcha" for newbies.

Another thing I don't like, exactly for the same reason, is the "class
variable" vs "instance variable" declarations.


Solving these two "problems" would contribute to help Python adoption, IMHO.

Last, I really miss the C/C++ "?" operator, but please, don't start that
thread again ;)
______________________________________________________
   Gaetan Corneau
   Software Developer 
   Software Engineering Process Group
   BaaN  Supply Chain Solutions  
   http://www.baan.com
   E-mail: Gaetan_Corneau at baan.com                  
   Tel: (418) 266-8252         
______________________________________________________
"Profanity is the one language all programmers know best"


-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/B/MU d- s+:++ a C++ 
UL+ P--- W+ N- K- W++ t-- 
!5 X- R+ tv-- b++ DI++ 
G e++ h---- r+++ y++++
------END GEEK CODE BLOCK------





More information about the Python-list mailing list