1
0
forked from VimPlug/jedi

Type tests and implementation for functions.

This commit is contained in:
Dave Halter
2015-07-01 14:54:23 +02:00
parent d1218c97bf
commit 3ac8f02841
3 changed files with 10 additions and 0 deletions

View File

@@ -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')

View File

@@ -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)

View File

@@ -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
# ----------------- # -----------------