Does Python really follow its philosophy of "Readability counts"?



I am sorry all I am not here to just blame Python. This is just an
introspection of whether
what I believe is right. Being a devotee of Python from past 2 years I
have been writing only
small apps and singing praises about Python where ever I go. I now got
a chance to read
Django's code for some reason. I have now strongly started feeling if
Python really follows its
"Readability Counts" philosophy. For example,

class A:
a = 10
b = "Madhu"

def somemethod(self, arg1):
self.c = 20.22
d = "some local variable"
# do something
....
...
def somemethod2 (self, arg2):
self.c = "Changed the variable"
# do something 2
...

In such situations, where the Instance variables come into existence
only when they are used
it is very difficult to track the flow of code. Its obviously not
possible to remember what
instance variable was defined where, when reading some substantial
amount of code and where
it was manipulated for that matter. It becomes so very frustrating
even when reading a Class's
code with just 6-8 methods and not more than 100-150 lines of code.

I am interested in knowing if I am reading this kind of code in the
wrong way mostly because
of C++/Java hangover since most other languages follow the same
approach as them? If there
is a Pythonic way reading this code for better readability? What made
Python developers to
adopt this strange strategy keeping "Readibility Counts" in mind?

-- Python Rocks!
Madhusudan.C.S
.



Relevant Pages

  • Re: New Chair
    ... Python, they're all DragonBallZ rejects and watch manga or whatever it is. ... quote the skit nearly word for word in the parrot falsetto voice. ... in them days we'd have been glad to have the price of a cup of tea. ... Reading David Webers's In Fury Born, there's a nice take on the "in my ...
    (comp.sys.ibm.pc.games.action)
  • Re: Newbie completely confused
    ... Your program uses quite a bit of memory. ... And really, reading 30MB files should not be such a problem, right? ... 'del LINES' deletes the lines that are read from the file, but not all of your data structures that you created out of them. ... The python code loads a module written in C++ and some of the member variables actually point to C++ objects created dynamically, so one actually has to call their destructors before unbinding the python var. ...
    (comp.lang.python)
  • Re: Getting back to Angband and Oangband
    ... I have gotten the Angband itch again. ... O is still my second-favourite variant. ... Python in standalone binaries: I know there are tools for Windows, ... interesting reading - but OTOH a new game holds even more possibilities. ...
    (rec.games.roguelike.angband)
  • Re: Does Python really follow its philosophy of "Readability counts"?
    ... Being a devotee of Python from past 2 years I ... Those are class variables, not instance variables. ... def somemethod2: ... when reading some substantial ...
    (comp.lang.python)
  • Re: 2.6, 3.0, and truly independent intepreters
    ... The GIL makes Python ... language designers think the same way. ... Reading this PDF paper is extremely interesting (albeit somewhat dependent ... I have noted the multiprocessing module that is new to Python 2.6/3.0 being ...
    (comp.lang.python)