forked from VimPlug/jedi
Type tests and implementation for functions.
This commit is contained in:
@@ -475,7 +475,9 @@ def _create_from_name(module, parent, name):
|
|||||||
|
|
||||||
|
|
||||||
builtin = Builtin(_builtins)
|
builtin = Builtin(_builtins)
|
||||||
|
# TODO Rename magic_function_class to just function_class or something similar.
|
||||||
magic_function_class = CompiledObject(type(load_module), parent=builtin)
|
magic_function_class = CompiledObject(type(load_module), parent=builtin)
|
||||||
|
module_class = CompiledObject(type(os))
|
||||||
generator_obj = CompiledObject(_a_generator(1.0))
|
generator_obj = CompiledObject(_a_generator(1.0))
|
||||||
_type_names_dict = builtin.get_by_name('type').names_dict
|
_type_names_dict = builtin.get_by_name('type').names_dict
|
||||||
none_obj = builtin.get_by_name('None')
|
none_obj = builtin.get_by_name('None')
|
||||||
|
|||||||
@@ -853,6 +853,9 @@ class ModuleWrapper(use_metaclass(CachedMetaClass, tree.Module, Wrapper)):
|
|||||||
|
|
||||||
return names
|
return names
|
||||||
|
|
||||||
|
def py__class__(self, evaluator):
|
||||||
|
return compiled.module_class
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
return getattr(self._module, name)
|
return getattr(self._module, name)
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,11 @@ type(x for x in [])
|
|||||||
#? type(x)
|
#? type(x)
|
||||||
type(lambda: x)
|
type(lambda: x)
|
||||||
|
|
||||||
|
import math
|
||||||
|
import os
|
||||||
|
#? type(os)
|
||||||
|
type(math)
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# re
|
# re
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|||||||
Reference in New Issue
Block a user