Home
last modified time | relevance | path

Searched refs:fromlist (Results 1 - 23 of 23) sorted by relevance

/third_party/python/Lib/test/test_importlib/import_/
H A Dtest_fromlist.py1 """Test that the semantics relating to the 'fromlist' argument are correct."""
9 """The use of fromlist influences what import returns.
12 returned [import return]. But if fromlist is set, then the specified module
29 module = self.__import__('pkg.module', fromlist=['attr'])
40 """Using fromlist triggers different actions based on what is being asked
43 If fromlist specifies an object on a module, nothing special happens
46 If a package is being imported, then what is listed in fromlist may be
49 to be the only name in the fromlist [using * with others].
57 module = self.__import__('module', fromlist=['attr'])
64 module = self.__import__('module', fromlist
[all...]
H A Dtest_relative_imports.py82 module = self.__import__('', global_, fromlist=['mod2'], level=1)
94 module = self.__import__('mod2', global_, fromlist=['attr'],
107 module = self.__import__('', global_, fromlist=['module'],
120 module = self.__import__('', global_, fromlist=['attr'], level=1)
131 module = self.__import__('', global_, fromlist=['subpkg2'],
149 module = self.__import__('', global_, fromlist=['attr'], level=6)
161 self.__import__('', global_, fromlist=['top_level'],
172 self.__import__('', global_, fromlist=['top_level'],
194 fromlist=['nephew'],
200 # Import a relative module w/ no fromlist
[all...]
H A Dtest_api.py64 # If something in fromlist doesn't exist, that's okay.
71 self.__import__(PKG_NAME, fromlist=['not here'])
74 # If something in fromlist triggers an exception not related to not
84 fromlist=[SUBMOD_NAME.rpartition('.')[-1]])
87 # If fromlist entry is None, let a ModuleNotFoundError propagate.
97 fromlist=[SUBMOD_NAME.rpartition('.')[-1]])
H A Dtest_caching.py19 [from cache to attribute] or pulled in thanks to a fromlist import
20 [from cache for fromlist]. But if sys.modules contains None then
88 # [from cache for fromlist]
93 module = self.__import__('pkg', fromlist=['module'])
H A Dtest___package__.py43 fromlist=['attr'], level=2)
/third_party/python/Lib/
H A Dmodulefinder.py162 def import_hook(self, name, caller=None, fromlist=None, level=-1):
163 self.msg(3, "import_hook", name, caller, fromlist, level)
167 if not fromlist:
170 self.ensure_fromlist(m, fromlist)
250 def ensure_fromlist(self, m, fromlist, recursive=0):
251 self.msg(4, "ensure_fromlist", m, fromlist, recursive)
252 for sub in fromlist:
361 def _safe_import_hook(self, name, caller, fromlist, level=-1):
375 if fromlist:
376 for sub in fromlist
[all...]
H A Ddifflib.py1822 fromlist,tolist = [],[]
1823 self._split_line(fromlist,fromline,fromtext)
1827 while fromlist or tolist:
1828 if fromlist:
1829 fromdata = fromlist.pop(0)
1845 fromlist,tolist,flaglist = [],[],[]
1850 fromlist.append(self._format_line(0,flag,*fromdata))
1854 fromlist.append(None)
1857 return fromlist,tolist,flaglist
1893 def _convert_flags(self,fromlist,tolis
[all...]
H A Ddis.py654 Generate triplets (name, level, fromlist) where
655 name is the imported module and level, fromlist are
671 fromlist = _get_const_value(from_op[0], from_op[1], consts)
672 yield (names[oparg], level, fromlist)
/third_party/python/Tools/demo/
H A Dvector.py45 def fromlist(cls, v): member in Vec
69 return Vec.fromlist(v)
74 return Vec.fromlist(v)
79 return Vec.fromlist(v)
/third_party/python/Include/
H A Dimport.h56 PyObject *fromlist,
64 PyObject *fromlist,
/third_party/python/Python/clinic/
H A Dbltinmodule.c.h6 "__import__($module, /, name, globals=None, locals=None, fromlist=(),\n"
17 "they are not modified. The locals argument is unused. The fromlist\n"
21 "returns package A when fromlist is empty, but its submodule B when\n"
22 "fromlist is not empty. The level argument is used to determine whether to\n"
31 PyObject *locals, PyObject *fromlist, int level);
37 static const char * const _keywords[] = {"name", "globals", "locals", "fromlist", "level", NULL}; in builtin___import__()
44 PyObject *fromlist = NULL; in builtin___import__() local
68 fromlist = args[3]; in builtin___import__()
78 return_value = builtin___import___impl(module, name, globals, locals, fromlist, level); in builtin___import__()
/third_party/python/Lib/dbm/
H A D__init__.py68 mod = __import__(name, fromlist=['open'])
/third_party/python/Lib/test/
H A Dtest_array.py313 a.fromlist(data2)
321 a.fromlist(data2)
330 a.fromlist(data2)
338 a.fromlist(data2)
503 self.assertRaises(TypeError, b.fromlist)
504 self.assertRaises(TypeError, b.fromlist, 42)
505 self.assertRaises(TypeError, b.fromlist, [None])
506 b.fromlist(a.tolist())
1078 self.assertRaises(BufferError, a.fromlist, a.tolist())
1543 example.fromlist([1
[all...]
H A Dtest_dbm.py23 mod = __import__(name, fromlist=['open'])
H A Dtest_builtin.py170 locals={}, fromlist=('foo',), level=1)
/third_party/python/Lib/encodings/
H A D__init__.py99 mod = __import__('encodings.' + modname, fromlist=_import_tail,
/third_party/python/Lib/importlib/
H A D_bootstrap.py1207 def _handle_fromlist(module, fromlist, import_, *, recursive=False):
1215 # The hell that is fromlist ...
1216 # If a package was imported, try to import stuff from fromlist.
1217 for x in fromlist:
1235 # imports triggered by fromlist for modules that don't
1271 def __import__(name, globals=None, locals=None, fromlist=(), level=0):
1276 'fromlist' argument specifies what should exist as attributes on the module
1277 being imported (e.g. ``from module import <fromlist>``). The 'level'
1288 if not fromlist:
1303 return _handle_fromlist(module, fromlist, _gcd_impor
[all...]
H A Dutil.py94 parent = __import__(parent_name, fromlist=['__path__'])
/third_party/python/Python/
H A Dimport.c1777 PyObject *locals, PyObject *fromlist, in PyImport_ImportModuleLevelObject()
1842 if (fromlist != NULL && fromlist != Py_None) { in PyImport_ImportModuleLevelObject()
1843 has_from = PyObject_IsTrue(fromlist); in PyImport_ImportModuleLevelObject()
1908 mod, fromlist, interp->import_func, NULL); in PyImport_ImportModuleLevelObject()
1928 PyObject *fromlist, int level) in PyImport_ImportModuleLevel()
1935 fromlist, level); in PyImport_ImportModuleLevel()
1776 PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level) PyImport_ImportModuleLevelObject() argument
1927 PyImport_ImportModuleLevel(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level) PyImport_ImportModuleLevel() argument
H A Dbltinmodule.c252 fromlist: object(c_default="NULL") = ()
262 they are not modified. The locals argument is unused. The fromlist
266 returns package A when fromlist is empty, but its submodule B when
267 fromlist is not empty. The level argument is used to determine whether to
274 PyObject *locals, PyObject *fromlist, int level) in builtin___import___impl()
278 fromlist, level); in builtin___import___impl()
273 builtin___import___impl(PyObject *module, PyObject *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level) builtin___import___impl() argument
H A Dceval.c3948 PyObject *fromlist = POP(); local
3951 res = import_name(tstate, frame, name, fromlist, level);
3953 Py_DECREF(fromlist);
7410 PyObject *name, PyObject *fromlist, PyObject *level)
7433 fromlist,
7443 stack[3] = fromlist;
7409 import_name(PyThreadState *tstate, _PyInterpreterFrame *frame, PyObject *name, PyObject *fromlist, PyObject *level) global() argument
/third_party/python/Lib/test/test_import/
H A D__init__.py405 __import__('http', fromlist=['blah'])
407 self.fail("fromlist must allow bogus names")
/third_party/protobuf/python/google/protobuf/internal/
H A Dmessage_test.py2575 __import__(module_name, fromlist=[class_name])

Completed in 37 milliseconds