-
Recent Posts
Recent Comments
- tb on Pre-compiled binaries for PyCrypto 2.6.1 (py27) on Win7
- Dominik on Pre-compiled binaries for PyCrypto 2.6.1 (py27) on Win7
- admin on Package dk
- admin on django :: list_display can’t sort on attribute of foreign key field…
- Anika Dejong Butler on django :: list_display can’t sort on attribute of foreign key field…
Archives
Categories
Meta
Category Archives: Python
Python :: property set
It looks like Python is getting tuples with named members in 2.6 (http://www.oluyede.org/blog/2007/03/11/updates-from-python-svn-part-2/ and http://docs.python.org/dev/lib/named-tuple-factory.html). I suspect many of us have implemented similar functionality ourselves, e.g. Shannon -jj Behrens describes how he sometimes uses dictionaries to return composite polymorphic values … Continue reading
Posted in Python
Leave a comment
Python :: flatten
Although it can seem like a CS excercise, everyone will sooner or later have to write a “flatten” function — a function that takes a nested “list” and makes it one-dimensional: [sourcecode language=”Python”] >>> flatten([1,2, [3,4], 5]) [1, 2, 3, … Continue reading
Posted in Python
Leave a comment
Python :: defprop – a very simple idiom for defining properties
Most attempts at making it easier to define properties in Python seem to quickly descend into metaclass obscurity. Metaclasses can surely solve the problem for an appropriate definition of solve, but “Explicit is better than implicit”, and “Simple is better … Continue reading
Posted in Python
Leave a comment