sufficiently pythonic code for testing type of function
onurb at xiludom.gro
Wed Oct 11 17:35:23 CEST 2006
> On 2006-10-11, Bruno Desthuilliers <onurb at xiludom.gro> wrote:
>> Now the real question : what if the object is not an instance of any of
>> the types, but still support the expected interface ?
> one possible answer: Use ZopeInterfaces
> (and ask objects 'do you implement interface X' rather than 'are you type Y')
> Not sure what options you have when dealing with builtin data types however.
This was mostly a rethorical question...
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"
More information about the Python-list