python type function for built-in types -



python type function for built-in types -

i see can utilize type create object @ runtime using class name

type('foo',(object,), dict(x=1))

how can int or str or datetimetype.

type('datetimetype', (object,), dict(???)

what dict value be? storing tuple(row) db query csv. when read back, want convert original tuple can utilize existing functions process tuple. read back

joe,23,dec 11 2001

i have saved type string of each type know cast to.

python python-2.7

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -