¡@

Home 

python Programming Glossary: sub2

Customary To Inherit Metaclasses From type?

http://stackoverflow.com/questions/2149846/customary-to-inherit-metaclasses-from-type

class c2 object __metaclass__ m2 m2 called for c2 class sub2 c1 c2 pass type sub2 type 'type' Note that when defining sub1.. m2 m2 called for c2 class sub2 c1 c2 pass type sub2 type 'type' Note that when defining sub1 and sub2 no metaclass.. type sub2 type 'type' Note that when defining sub1 and sub2 no metaclass functions were called. They will be created exactly..

Python string formatting: % vs. .format

http://stackoverflow.com/questions/5082452/python-string-formatting-vs-format

what is the difference # usr bin python sub1 python string sub2 an arg a i am a s sub1 b i am a 0 .format sub1 c with kwarg.. am a s sub1 b i am a 0 .format sub1 c with kwarg s 'kwarg' sub2 d with kwarg .format kwarg sub2 print a print b print c print.. c with kwarg s 'kwarg' sub2 d with kwarg .format kwarg sub2 print a print b print c print d Furthermore when does string..

How to do relative imports in Python?

http://stackoverflow.com/questions/72852/how-to-do-relative-imports-in-python

structure app __init__.py sub1 __init__.py mod1.py sub2 __init__.py mod2.py I'm coding mod1 and I need to import something.. something from mod2 . How should I do it I tried from ..sub2 import mod2 but I'm getting an Attempted relative import in.. 's are currently empty Edit2 I'm trying to do this because sub2 contains classes that are shared across sub packages sub1 subX..