Eureka moments in Python

Ben Finney bignose+hates-spam at benfinney.id.au
Tue Mar 13 21:29:53 EDT 2007


"Steven D'Aprano" <steve at REMOVEME.cybersource.com.au> writes:

> I'd be interested in hearing people's stories of Eureka moments in
> Python, moments where you suddenly realise that some task which
> seemed like it would be hard work was easy with Python.

I don't recall the exact context, but Python was the language that
introduced me to the power of a unified type system.

The application I was writing was doing a whole lot of bookkeeping of
information about what kind of data was being processed, which had to
be kept updated in parallel with the data itself. Once I realised that
"unified type system" and "first-class objects" meant that I could
simply store the *type itself* as data, whether a basic type or one of
my own, things became astoundingly easier. Soon after that I learned
that functions are also objects, and I was hooked.

I also don't think I would have been at all interested in Test-Driven
Development if I wasn't already familiar with Python's object model,
since it makes introspection and unit-test stubs and shims a
breeze. So I lay a lot of the blame on Python for getting me test
infected :-)

-- 
 \         "I may disagree with what you say, but I will defend to the |
  `\    death your right to mis-attribute this quote to Voltaire."  -- |
_o__)                      Avram Grumer, rec.arts.sf.written, May 2000 |
Ben Finney




More information about the Python-list mailing list