Object Oriented vs Pythonic Code, and Pythonic standards
Carl J. Van Arsdall
cvanarsdall at mvista.com
Tue Feb 7 13:43:25 EST 2006
It seems the more I come to learn about Python as a langauge and the way
its used I've come across several discussions where people discuss how
to do things using an OO model and then how to design software in a more
"Pythonic" way.
My question is, should we as python developers be trying to write code
that follows more of a python standard or should we try to spend our
efforts to stick to a more traditional OO model?
For example, in C++ I might make a file that defines a class and all its
methods, at which point I create an object and do things with it. My
interpretation of what is "Pythonic" would be instead of creating a
class I would just define functions and maybe some variables global to a
module. At this point, I import the module and just make function calls.
There are many similarities here, but the difference is that in python I
don't feel as though I would define a class, I would just treat the
python module as a class instead, especially if it was a type of object
that I would only need a single instance of.
The second question that arises from Pythonism is, has the community
drafted a standard for quality "Pythonic" code?
Thanks,
carl
--
Carl J. Van Arsdall
cvanarsdall at mvista.com
Build and Release
MontaVista Software
More information about the Python-list
mailing list