Python's biggest compromises

Andrew Dalke adalke at mindspring.com
Thu Jul 31 18:00:33 EDT 2003


Edward K. Ream:
> There aren't any [compromises in Python]

There are definitely compromises in Python.  As Christopher Koppler
pointed out, Python does compromise for backwards compatibility.
If you want, you can write "1 <> 2" and it will work, even though that
feature has been deprecated for about 8 years.  Similarly, string exceptions
were deprecated about 5 years ago, but you can still use them.

And now with new-style types you can use

class OldSpam:
   eggs = attribute(_get_eggs, _set_eggs)

class NewSpam(object):
   eggs = attribute(_get_eggs, _set_eggs)

and get slightly different behaviours.

These exist as a compromise between the old way (plenty of existing
source code) and the new way (which provides better ways to do
older behaviours).

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list