Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Python discussion, anybody?




Hi all python fans (and enemies) out there!

I recently started to look at python for a 
small programming project. 
Some things seems very good, others I can 
live with but there is one issue that
keeps bugging me.

Consider: 
> class C:
>     def __init__(self):
>         self.member = 17
> 
> cobj=C()
> cobj.memmber = 18 
> print cobj.member 
What will be printed? If you think "18", read
again.

This is my major, and perhaps only, case against 
python but in my mind it disqualifies python for
any program larger than, say, 1000 LOC.

Is there a way trap this (like "use strict;"
in perl)? 
Or am I just stupid and completely wrong for
wanting this?

From browsing around www.python.org I realize 
that variable declarations are not popular
in the python community but I fail to see
why. The only argument against seems to be
that it might make the python programs a little
longer. And of course, that C++ has it.

/Fredric Fredricson

PS. 
Do I always use "use strict;" in perl? 
Does the pope wear funny hats? Of course!

Do I like type safe computer languages? 
Guilty as charged!
(One might ask: then why do I use perl but 
"consistency is the mark of a small mind"[1] ;-)


[1] Think it's Mark Twain, but I'm not sure...


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links