python without OO

Steven Bethard steven.bethard at gmail.com
Tue Jan 25 17:02:05 EST 2005


Davor wrote:
> Is it possible to write purely procedural code in Python, or the OO
> constructs in both language and supporting libraries have got so
> embedded that it's impossible to avoid them?

Hmmm...  sorta depends on how you define write procedural code...  If 
you mean, can you write Python code without accessing object attributes 
(e.g. lst.sort()), then the answer's probably almost certainly no.  If 
you mean can you write Python code without ever writing a class, the 
answer's probably yes.  It'll make some things harder, and it'll 
probably make some modules off-limits, but it's doable.

Could you clarify what you mean by "write purely procedural code"?

Steve



More information about the Python-list mailing list