diff --git a/python/helpers/generator3.py b/python/helpers/generator3.py index 0ae7b6e1aa9e..4cbbb9bfd457 100644 --- a/python/helpers/generator3.py +++ b/python/helpers/generator3.py @@ -24,7 +24,7 @@ but seemingly no one uses them in C extensions yet anyway. # * re.search-bound, ~30% time, in likes of builtins and _gtk with complex docstrings. # None of this can seemingly be easily helped. Maybe there's a simpler and faster parser library? -VERSION = "1.123" # Must be a number-dot-number string, updated with each change that affects generated skeletons +VERSION = "1.124" # Must be a number-dot-number string, updated with each change that affects generated skeletons # Note: DON'T FORGET TO UPDATE! import sys @@ -1300,7 +1300,7 @@ class ModuleRedeclarator(object): if found_name: if found_name == as_name: notice = " # (!) real value is %r" % s - s = "object()" + s = "None" else: notice = " # (!) forward: %s, real value is %r" % (found_name, s) if SANE_REPR_RE.match(s): @@ -1308,7 +1308,7 @@ class ModuleRedeclarator(object): else: if not found_name: notice = " # (!) real value is %r" % s - out(indent, prefix, "object()", postfix, notice) + out(indent, prefix, "None", postfix, notice) def getRetType(self, s): diff --git a/python/helpers/required_gen_version b/python/helpers/required_gen_version index ae5e26e48e1b..124263039ad3 100644 --- a/python/helpers/required_gen_version +++ b/python/helpers/required_gen_version @@ -6,7 +6,7 @@ (default) 1.92 # anything not explicitly marked -(built-in) 1.123 # skeletons of all built-in modules are built together +(built-in) 1.124 # skeletons of all built-in modules are built together # Note: modules like itertools, etc are "(built-in)" and are ignored if given separately _fileio 1.101 @@ -15,7 +15,7 @@ sys 1.101 thread 1.102 _thread 1.102 _struct 1.103 -datetime 1.121 +datetime 1.124 PyQt4.Qsci 1.94 PyQt4.QtAssistant 1.94 diff --git a/python/src/com/jetbrains/python/psi/types/PyTypeChecker.java b/python/src/com/jetbrains/python/psi/types/PyTypeChecker.java index d998ec79dbab..f2d4c91bb80c 100644 --- a/python/src/com/jetbrains/python/psi/types/PyTypeChecker.java +++ b/python/src/com/jetbrains/python/psi/types/PyTypeChecker.java @@ -48,8 +48,11 @@ public class PyTypeChecker { if (expected == null || actual == null) { return true; } - if (isObjectType(expected) || isObjectType(actual)) { - return true; + if (expected instanceof PyClassType) { + final PyClass c = ((PyClassType)expected).getPyClass(); + if (c != null && "object".equals(c.getName())) { + return true; + } } if ((expected instanceof PyTypeReference || actual instanceof PyTypeReference) && !recursive) { return true; @@ -158,16 +161,6 @@ public class PyTypeChecker { return false; } - private static boolean isObjectType(@NotNull PyType type) { - if (type instanceof PyClassType) { - final PyClass c = ((PyClassType)type).getPyClass(); - if ("object".equals(c.getName())) { - return true; - } - } - return false; - } - public static boolean isUnknown(@Nullable PyType type) { if (type == null || type instanceof PyTypeReference || type instanceof PyGenericType) { return true;