I have a structure that works:
import a.b.c a.b.c.foo()
and this also works:
from a.b import c c.foo()
but this does not work:
from a import b.c b.c.foo()
and does not:
from a import b b.c.foo()
How can I import to b.c.foo()work?
b.c.foo()
Just rename it:
from a.b import c as BAR BAR.foo()
In your package byou need to add ' import c' so that it is always available as part b.
b
import c
from a import b from a.b import c b.c = c
import a.b.c from a import b b.c.foo()
The order of the import statements does not matter.
Source: https://habr.com/ru/post/1714274/More articles:QT Model / View programming with complex data structures - design-patternsSQL - two external joins - sqlTroubleshoot iPhone after Update 3.0.1 - objective-cCompatible VistaDB with Microsoft Enterprise Library DAAB? - databasePdf reading detection in MsIE - internet-explorerCenter rotation UIView - iphoneThe most compact way to count the number of lines in a file in C ++ - c ++Comb line recursively in all .htaccess files - linuxC ++ STL map typedef errors - c ++Effective customer interaction RESTful - restAll Articles