diff --git a/python/helpers/pycharm_generator_utils/constants.py b/python/helpers/pycharm_generator_utils/constants.py index 167deb5c1982..c1b5f83f6af9 100644 --- a/python/helpers/pycharm_generator_utils/constants.py +++ b/python/helpers/pycharm_generator_utils/constants.py @@ -6,7 +6,7 @@ import string import time # !!! Don't forget to update VERSION and required_gen_version if necessary !!! -VERSION = "1.137" +VERSION = "1.138" OUT_ENCODING = 'utf-8' @@ -418,15 +418,15 @@ else: (None, "open")] = "(file, mode='r', buffering=None, encoding=None, errors=None, newline=None, closefd=True)" PREDEFINED_BUILTIN_SIGS[ ("str", "__init__")] = "(self, value='', encoding=None, errors='strict')" # overrides a fake - PREDEFINED_BUILTIN_SIGS[("str", "format")] = "(*args, **kwargs)" + PREDEFINED_BUILTIN_SIGS[("str", "format")] = "(self, *args, **kwargs)" PREDEFINED_BUILTIN_SIGS[ ("bytes", "__init__")] = "(self, value=b'', encoding=None, errors='strict')" # overrides a fake - PREDEFINED_BUILTIN_SIGS[("bytes", "format")] = "(*args, **kwargs)" - PREDEFINED_BUILTIN_SIGS[(None, "print")] = "(*args, sep=' ', end='\\n', file=None)" # proper signature + PREDEFINED_BUILTIN_SIGS[("bytes", "format")] = "(self, *args, **kwargs)" + PREDEFINED_BUILTIN_SIGS[(None, "print")] = "(self, *args, sep=' ', end='\\n', file=None)" # proper signature if (2, 6) <= version < (3, 0): - PREDEFINED_BUILTIN_SIGS[("unicode", "format")] = "(*args, **kwargs)" - PREDEFINED_BUILTIN_SIGS[("str", "format")] = "(*args, **kwargs)" + PREDEFINED_BUILTIN_SIGS[("unicode", "format")] = "(self, *args, **kwargs)" + PREDEFINED_BUILTIN_SIGS[("str", "format")] = "(self, *args, **kwargs)" if version == (2, 5): PREDEFINED_BUILTIN_SIGS[("unicode", "splitlines")] = "(keepends=None)" # a typo in docstring there diff --git a/python/helpers/required_gen_version b/python/helpers/required_gen_version index b9dc50e70d5e..5baf0ec0e1ca 100644 --- a/python/helpers/required_gen_version +++ b/python/helpers/required_gen_version @@ -6,7 +6,7 @@ (default) 1.127 # anything not explicitly marked -(built-in) 1.137 # skeletons of all built-in modules are built together +(built-in) 1.138 # 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.127 diff --git a/python/testData/MockSdk2.7/python_stubs/__builtin__.py b/python/testData/MockSdk2.7/python_stubs/__builtin__.py index e9abc1264d32..01f138ec56bc 100644 --- a/python/testData/MockSdk2.7/python_stubs/__builtin__.py +++ b/python/testData/MockSdk2.7/python_stubs/__builtin__.py @@ -1,7 +1,7 @@ # encoding: utf-8 # module __builtin__ # from (built-in) -# by generator 1.136 +# by generator 1.138 from __future__ import print_function """ Built-in functions, exceptions, and other objects. @@ -343,7 +343,7 @@ def len(p_object): # real signature unknown; restored from __doc__ """ len(object) -> integer - Return the number of items of a sequence or mapping. + Return the number of items of a sequence or collection. """ return 0 @@ -665,6 +665,7 @@ class __method(object): self.__self__ = None + class __namedtuple(tuple): '''A mock base class for named tuples.''' @@ -1823,7 +1824,7 @@ class str(basestring): """ return 0 - def format(*args, **kwargs): # known special case of str.format + def format(self, *args, **kwargs): # known special case of str.format """ S.format(*args, **kwargs) -> string @@ -4451,10 +4452,6 @@ class tuple(object): """ x.__rmul__(n) <==> n*x """ pass - def __sizeof__(self): # real signature unknown; restored from __doc__ - """ T.__sizeof__() -- size of T in memory, in bytes """ - pass - class type(object): """ @@ -4662,7 +4659,7 @@ class unicode(basestring): """ return 0 - def format(*args, **kwargs): # known special case of unicode.format + def format(self, *args, **kwargs): # known special case of unicode.format """ S.format(*args, **kwargs) -> unicode diff --git a/python/testData/MockSdk2.7/python_stubs/_io.py b/python/testData/MockSdk2.7/python_stubs/_io.py index 9f0102336207..4d642d29fd9f 100644 --- a/python/testData/MockSdk2.7/python_stubs/_io.py +++ b/python/testData/MockSdk2.7/python_stubs/_io.py @@ -1,15 +1,15 @@ # encoding: utf-8 # module _io -# from /home/user/.virtualenvs/obraz-py2.7/lib/python2.7/lib-dynload/_io.so -# by generator 1.127 +# from /Users/vlan/.virtualenvs/obraz-py2.7/lib/python2.7/lib-dynload/_io.so +# by generator 1.137 """ The io module provides the Python interfaces to stream handling. The builtin open function is defined in this module. At the top of the I/O hierarchy is the abstract base class IOBase. It defines the basic interface to a stream. Note, however, that there is no -seperation between reading and writing to streams; implementations are -allowed to throw an IOError if they do not support a given operation. +separation between reading and writing to streams; implementations are +allowed to raise an IOError if they do not support a given operation. Extending IOBase is RawIOBase which deals simply with the reading and writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide @@ -185,8 +185,8 @@ class _IOBase(object): bytes. bytearrays are accepted too, and in some cases (such as readinto) needed. Text I/O classes work with str data. - Note that calling any method (even inquiries) on a closed stream is - undefined. Implementations may raise IOError in this case. + Note that calling any method (except additional calls to close(), + which are ignored) on a closed stream should raise a ValueError. IOBase (and its subclasses) support the iterator protocol, meaning that an IOBase object can be iterated over yielding the lines in a @@ -248,8 +248,7 @@ class _IOBase(object): If limit is specified, at most limit bytes will be read. - The line terminator is always b' - ' for binary files; for text + The line terminator is always b'\n' for binary files; for text files, the newlines argument to open can be used to select the line terminator(s) recognized. """ @@ -269,7 +268,7 @@ class _IOBase(object): """ Change stream position. - Change the stream position to byte offset offset. offset is + Change the stream position to the given byte offset. The offset is interpreted relative to the position indicated by whence. Values for whence are: @@ -498,6 +497,9 @@ class BufferedRandom(_BufferedIOBase): """ x.__repr__() <==> repr(x) """ pass + def __sizeof__(self, *args, **kwargs): # real signature unknown + pass + closed = property(lambda self: object(), lambda self, v: None, lambda self: None) # default mode = property(lambda self: object(), lambda self, v: None, lambda self: None) # default @@ -571,6 +573,9 @@ class BufferedReader(_BufferedIOBase): """ x.__repr__() <==> repr(x) """ pass + def __sizeof__(self, *args, **kwargs): # real signature unknown + pass + closed = property(lambda self: object(), lambda self, v: None, lambda self: None) # default mode = property(lambda self: object(), lambda self, v: None, lambda self: None) # default @@ -691,6 +696,9 @@ class BufferedWriter(_BufferedIOBase): """ x.__repr__() <==> repr(x) """ pass + def __sizeof__(self, *args, **kwargs): # real signature unknown + pass + closed = property(lambda self: object(), lambda self, v: None, lambda self: None) # default mode = property(lambda self: object(), lambda self, v: None, lambda self: None) # default @@ -755,7 +763,8 @@ class BytesIO(_BufferedIOBase): """ pass - def readable(self, *args, **kwargs): # real signature unknown + def readable(self): # real signature unknown; restored from __doc__ + """ readable() -> bool. Returns True if the IO object can be read. """ pass def readinto(self, bytearray): # real signature unknown; restored from __doc__ @@ -799,7 +808,8 @@ class BytesIO(_BufferedIOBase): """ pass - def seekable(self, *args, **kwargs): # real signature unknown + def seekable(self): # real signature unknown; restored from __doc__ + """ seekable() -> bool. Returns True if the IO object can be seeked. """ pass def tell(self): # real signature unknown; restored from __doc__ @@ -815,7 +825,8 @@ class BytesIO(_BufferedIOBase): """ pass - def writable(self, *args, **kwargs): # real signature unknown + def writable(self): # real signature unknown; restored from __doc__ + """ writable() -> bool. Returns True if the IO object can be written. """ pass def write(self, bytes): # real signature unknown; restored from __doc__ @@ -854,6 +865,9 @@ class BytesIO(_BufferedIOBase): def __setstate__(self, *args, **kwargs): # real signature unknown pass + def __sizeof__(self, *args, **kwargs): # real signature unknown + pass + closed = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """True if the file is closed.""" @@ -876,7 +890,7 @@ class FileIO(_RawIOBase): """ file(name: str[, mode: str]) -> file IO object - Open a file. The mode can be 'r', 'w' or 'a' for reading (default), + Open a file. The mode can be 'r' (default), 'w' or 'a' for reading, writing or appending. The file will be created if it doesn't exist when opened for writing or appending; it will be truncated when opened for writing. Add a '+' to the mode to allow simultaneous @@ -887,20 +901,16 @@ class FileIO(_RawIOBase): close() -> None. Close the file. A closed file cannot be used for further I/O operations. close() may be - called more than once without error. Changes the fileno to -1. + called more than once without error. """ pass def fileno(self): # real signature unknown; restored from __doc__ - """ - fileno() -> int. "file descriptor". - - This is needed for lower-level file interfaces, such the fcntl module. - """ + """ fileno() -> int. Return the underlying file descriptor (an integer). """ pass def isatty(self): # real signature unknown; restored from __doc__ - """ isatty() -> bool. True if the file is connected to a tty device. """ + """ isatty() -> bool. True if the file is connected to a TTY device. """ pass def read(self, size=-1): # known case of _io.FileIO.read @@ -932,13 +942,15 @@ class FileIO(_RawIOBase): def seek(self, offset, whence=None): # real signature unknown; restored from __doc__ """ - seek(offset: int[, whence: int]) -> None. Move to new file position. + seek(offset: int[, whence: int]) -> int. Move to new file position + and return the file position. Argument offset is a byte count. Optional argument whence defaults to - 0 (offset from start of file, offset should be >= 0); other values are 1 - (move relative to current position, positive or negative), and 2 (move - relative to end of file, usually negative, although many platforms allow - seeking beyond the end of a file). + SEEK_SET or 0 (offset from start of file, offset should be >= 0); other values + are SEEK_CUR or 1 (move relative to current position, positive or negative), + and SEEK_END or 2 (move relative to end of file, usually negative, although + many platforms allow seeking beyond the end of a file). + Note that not all file objects are seekable. """ pass @@ -948,14 +960,20 @@ class FileIO(_RawIOBase): pass def tell(self): # real signature unknown; restored from __doc__ - """ tell() -> int. Current file position """ + """ + tell() -> int. Current file position. + + Can raise OSError for non seekable files. + """ pass def truncate(self, size=None): # real signature unknown; restored from __doc__ """ - truncate([size: int]) -> None. Truncate the file to at most size bytes. + truncate([size: int]) -> int. Truncate the file to at most size bytes and + return the truncated size. - Size defaults to the current file position, as returned by tell().The current file position is changed to the value of size. + Size defaults to the current file position, as returned by tell(). + The current file position is changed to the value of size. """ pass @@ -968,7 +986,8 @@ class FileIO(_RawIOBase): write(b: bytes) -> int. Write bytes b to file, return number written. Only makes one system call, so not all of the data may be written. - The number of bytes actually written is returned. + The number of bytes actually written is returned. In non-blocking mode, + returns None if the write would block. """ pass @@ -992,7 +1011,7 @@ class FileIO(_RawIOBase): """True if the file is closed""" closefd = property(lambda self: object(), lambda self, v: None, lambda self: None) # default - """True if the file descriptor will be closed""" + """True if the file descriptor will be closed by close().""" mode = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """String giving the file mode""" @@ -1133,7 +1152,8 @@ class StringIO(_TextIOBase): """ pass - def readable(self, *args, **kwargs): # real signature unknown + def readable(self): # real signature unknown; restored from __doc__ + """ readable() -> bool. Returns True if the IO object can be read. """ pass def readline(self, *args, **kwargs): # real signature unknown @@ -1156,7 +1176,8 @@ class StringIO(_TextIOBase): """ pass - def seekable(self, *args, **kwargs): # real signature unknown + def seekable(self): # real signature unknown; restored from __doc__ + """ seekable() -> bool. Returns True if the IO object can be seeked. """ pass def tell(self, *args, **kwargs): # real signature unknown @@ -1173,7 +1194,8 @@ class StringIO(_TextIOBase): """ pass - def writable(self, *args, **kwargs): # real signature unknown + def writable(self): # real signature unknown; restored from __doc__ + """ writable() -> bool. Returns True if the IO object can be written. """ pass def write(self, *args, **kwargs): # real signature unknown @@ -1217,15 +1239,22 @@ class TextIOWrapper(_TextIOBase): errors determines the strictness of encoding and decoding (see the codecs.register) and defaults to "strict". - newline can be None, '', '\n', '\r', or '\r\n'. It controls the - handling of line endings. If it is None, universal newlines is - enabled. With this enabled, on input, the lines endings '\n', '\r', - or '\r\n' are translated to '\n' before being returned to the - caller. Conversely, on output, '\n' is translated to the system - default line seperator, os.linesep. If newline is any other of its - legal values, that newline becomes the newline when the file is read - and it is returned untranslated. On output, '\n' is converted to the - newline. + newline controls how line endings are handled. It can be None, '', + '\n', '\r', and '\r\n'. It works as follows: + + * On input, if newline is None, universal newlines mode is + enabled. Lines in the input can end in '\n', '\r', or '\r\n', and + these are translated into '\n' before being returned to the + caller. If it is '', universal newline mode is enabled, but line + endings are returned to the caller untranslated. If it has any of + the other legal values, input lines are only terminated by the given + string, and the line ending is returned to the caller untranslated. + + * On output, if newline is None, any '\n' characters written are + translated to the system default line separator, os.linesep. If + newline is '', no translation takes place. If newline is any of the + other legal values, any '\n' characters written are translated to + the given string. If line_buffering is True, a call to flush is implied when a call to write contains a newline character. diff --git a/python/testData/MockSdk2.7/python_stubs/datetime.py b/python/testData/MockSdk2.7/python_stubs/datetime.py index 85b0ac7961e2..eece4e84d2d7 100644 --- a/python/testData/MockSdk2.7/python_stubs/datetime.py +++ b/python/testData/MockSdk2.7/python_stubs/datetime.py @@ -1,7 +1,7 @@ # encoding: utf-8 # module datetime -# from /usr/lib/python2.7/lib-dynload/datetime.so -# by generator 1.124 +# from /Users/vlan/.virtualenvs/obraz-py2.7/lib/python2.7/lib-dynload/datetime.so +# by generator 1.137 """ Fast implementation of the datetime type. """ # no imports @@ -146,8 +146,14 @@ class date(object): pass day = property(lambda self: 0) + """:type: int""" + month = property(lambda self: 0) + """:type: int""" + year = property(lambda self: 0) + """:type: int""" + max = None # (!) real value is '' min = None # (!) real value is '' @@ -312,10 +318,19 @@ class datetime(date): pass hour = property(lambda self: 0) + """:type: int""" + microsecond = property(lambda self: 0) + """:type: int""" + minute = property(lambda self: 0) + """:type: int""" + second = property(lambda self: 0) - tzinfo = property(lambda self: object()) # default + """:type: int""" + + tzinfo = property(lambda self: object(), lambda self, v: None, lambda self: None) # default + max = None # (!) real value is '' min = None # (!) real value is '' @@ -414,10 +429,19 @@ class time(object): pass hour = property(lambda self: 0) + """:type: int""" + microsecond = property(lambda self: 0) + """:type: int""" + minute = property(lambda self: 0) + """:type: int""" + second = property(lambda self: 0) - tzinfo = property(lambda self: object()) # default + """:type: int""" + + tzinfo = property(lambda self: object(), lambda self, v: None, lambda self: None) # default + max = None # (!) real value is '' min = None # (!) real value is '' @@ -539,8 +563,23 @@ class timedelta(object): pass days = property(lambda self: 0) + """Number of days. + + :type: int + """ + microseconds = property(lambda self: 0) + """Number of microseconds (>= 0 and less than 1 second). + + :type: int + """ + seconds = property(lambda self: 0) + """Number of seconds (>= 0 and less than 1 day). + + :type: int + """ + max = None # (!) real value is '' min = None # (!) real value is '' diff --git a/python/testData/MockSdk2.7/python_stubs/exceptions.py b/python/testData/MockSdk2.7/python_stubs/exceptions.py index 9b86536cd704..e69ad0f05ea3 100644 --- a/python/testData/MockSdk2.7/python_stubs/exceptions.py +++ b/python/testData/MockSdk2.7/python_stubs/exceptions.py @@ -1,7 +1,7 @@ # encoding: utf-8 # module exceptions # from (built-in) -# by generator 1.124 +# by generator 1.138 """ Python's standard exception class hierarchy. @@ -68,7 +68,11 @@ class BaseException(object): return u"" args = property(lambda self: tuple()) + """:type: tuple""" + message = property(lambda self: '', lambda self, v: None, lambda self: None) + """:type: string""" + __dict__ = None # (!) real value is '' @@ -196,8 +200,23 @@ class EnvironmentError(StandardError): pass errno = property(lambda self: 0, lambda self, v: None, lambda self: None) + """exception errno + + :type: int + """ + filename = property(lambda self: '', lambda self, v: None, lambda self: None) + """exception filename + + :type: string + """ + strerror = property(lambda self: 0, lambda self, v: None, lambda self: None) + """exception strerror + + :type: int + """ + class EOFError(StandardError): @@ -284,11 +303,41 @@ class SyntaxError(StandardError): pass filename = property(lambda self: '', lambda self, v: None, lambda self: None) + """exception filename + + :type: string + """ + lineno = property(lambda self: 0, lambda self, v: None, lambda self: None) + """exception lineno + + :type: int + """ + msg = property(lambda self: '', lambda self, v: None, lambda self: None) + """exception msg + + :type: string + """ + offset = property(lambda self: 0, lambda self, v: None, lambda self: None) + """exception offset + + :type: int + """ + print_file_and_line = property(lambda self: True, lambda self, v: None, lambda self: None) + """exception print_file_and_line + + :type: bool + """ + text = property(lambda self: '', lambda self, v: None, lambda self: None) + """exception text + + :type: string + """ + class IndentationError(SyntaxError): @@ -583,11 +632,21 @@ class UnicodeDecodeError(UnicodeError): """ x.__str__() <==> str(x) """ pass - encoding = property(lambda self: object()) # default - end = property(lambda self: object()) # default - object = property(lambda self: object()) # default - reason = property(lambda self: object()) # default - start = property(lambda self: object()) # default + encoding = property(lambda self: object(), lambda self, v: None, lambda self: None) # default + """exception encoding""" + + end = property(lambda self: object(), lambda self, v: None, lambda self: None) # default + """exception end""" + + object = property(lambda self: object(), lambda self, v: None, lambda self: None) # default + """exception object""" + + reason = property(lambda self: object(), lambda self, v: None, lambda self: None) # default + """exception reason""" + + start = property(lambda self: object(), lambda self, v: None, lambda self: None) # default + """exception start""" + class UnicodeEncodeError(UnicodeError): @@ -605,10 +664,30 @@ class UnicodeEncodeError(UnicodeError): pass encoding = property(lambda self: '', lambda self, v: None, lambda self: None) + """exception encoding + + :type: string + """ + end = property(lambda self: 0, lambda self, v: None, lambda self: None) + """exception end + + :type: int + """ + object = property(lambda self: object(), lambda self, v: None, lambda self: None) reason = property(lambda self: '', lambda self, v: None, lambda self: None) + """exception reason + + :type: string + """ + start = property(lambda self: 0, lambda self, v: None, lambda self: None) + """exception start + + :type: int + """ + class UnicodeTranslateError(UnicodeError): @@ -626,10 +705,30 @@ class UnicodeTranslateError(UnicodeError): pass encoding = property(lambda self: '', lambda self, v: None, lambda self: None) + """exception encoding + + :type: string + """ + end = property(lambda self: 0, lambda self, v: None, lambda self: None) + """exception end + + :type: int + """ + object = property(lambda self: object(), lambda self, v: None, lambda self: None) reason = property(lambda self: '', lambda self, v: None, lambda self: None) + """exception reason + + :type: string + """ + start = property(lambda self: 0, lambda self, v: None, lambda self: None) + """exception start + + :type: int + """ + class UnicodeWarning(Warning): diff --git a/python/testData/MockSdk2.7/python_stubs/sys.py b/python/testData/MockSdk2.7/python_stubs/sys.py index b80979b3a0f3..9016bec31633 100644 --- a/python/testData/MockSdk2.7/python_stubs/sys.py +++ b/python/testData/MockSdk2.7/python_stubs/sys.py @@ -1,7 +1,7 @@ # encoding: utf-8 # module sys # from (built-in) -# by generator 1.124 +# by generator 1.138 """ This module provides access to some objects used or maintained by the interpreter and to functions that interact strongly with the interpreter. @@ -51,7 +51,7 @@ version_info -- version information as a named tuple hexversion -- version information encoded as a single integer copyright -- copyright notice pertaining to this interpreter platform -- platform identifier -executable -- pathname of this Python interpreter +executable -- absolute path of the executable binary of the Python interpreter prefix -- prefix used to find the Python library exec_prefix -- prefix used to find the machine-specific Python library float_repr_style -- string indicating the style of repr() output for floats @@ -88,35 +88,33 @@ api_version = 1013 byteorder = 'little' -copyright = 'Copyright (c) 2001-2011 Python Software Foundation.\nAll Rights Reserved.\n\nCopyright (c) 2000 BeOpen.com.\nAll Rights Reserved.\n\nCopyright (c) 1995-2001 Corporation for National Research Initiatives.\nAll Rights Reserved.\n\nCopyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\nAll Rights Reserved.' +copyright = 'Copyright (c) 2001-2015 Python Software Foundation.\nAll Rights Reserved.\n\nCopyright (c) 2000 BeOpen.com.\nAll Rights Reserved.\n\nCopyright (c) 1995-2001 Corporation for National Research Initiatives.\nAll Rights Reserved.\n\nCopyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\nAll Rights Reserved.' -dont_write_bytecode = False +dont_write_bytecode = True exc_type = None -executable = '/usr/bin/python2.7' +executable = '/Users/vlan/.virtualenvs/obraz-py2.7/bin/python' -exec_prefix = '/usr' +exec_prefix = '/Users/vlan/.virtualenvs/obraz-py2.7' float_repr_style = 'short' -hexversion = 34013936 +hexversion = 34015984 maxint = 9223372036854775807 maxsize = 9223372036854775807 -maxunicode = 1114111 +maxunicode = 65535 -platform = 'linux2' +platform = 'darwin' -prefix = '/usr' +prefix = '/Users/vlan/.virtualenvs/obraz-py2.7' py3kwarning = False -pydebug = False -version = '2.7.2+ (default, Jul 20 2012, 22:15:08) \n[GCC 4.6.1]' +real_prefix = '/System/Library/Frameworks/Python.framework/Versions/2.7' -__egginsert = 1 -__plen = 7 +version = '2.7.10 (default, Oct 23 2015, 18:05:06) \n[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)]' # functions @@ -145,7 +143,6 @@ def callstats(): # real signature unknown; restored from __doc__ """ return () - def call_tracing(func, args): # real signature unknown; restored from __doc__ """ call_tracing(func, args) -> object @@ -156,7 +153,6 @@ def call_tracing(func, args): # real signature unknown; restored from __doc__ """ return object() - def displayhook(p_object): # real signature unknown; restored from __doc__ """ displayhook(object) -> None @@ -165,12 +161,14 @@ def displayhook(p_object): # real signature unknown; restored from __doc__ """ pass - -def excepthook(exc_type, exc_obj, exc_tb): # reliably restored by inspect - """ Catch an uncaught exception and make a traceback. """ +def excepthook(exctype, value, traceback): # real signature unknown; restored from __doc__ + """ + excepthook(exctype, value, traceback) -> None + + Handle an exception by displaying it with a traceback on sys.stderr. + """ pass - def exc_clear(): # real signature unknown; restored from __doc__ """ exc_clear() -> None @@ -182,7 +180,6 @@ def exc_clear(): # real signature unknown; restored from __doc__ """ pass - def exc_info(): # real signature unknown; restored from __doc__ """ exc_info() -> (type, value, traceback) @@ -192,20 +189,18 @@ def exc_info(): # real signature unknown; restored from __doc__ """ pass - def exit(status=None): # real signature unknown; restored from __doc__ """ exit([status]) Exit the interpreter by raising SystemExit(status). If the status is omitted or None, it defaults to zero (i.e., success). - If the status is numeric, it will be used as the system exit status. + If the status is an integer, it will be used as the system exit status. If it is another kind of object, it will be printed and the system exit status will be one (i.e., failure). """ pass - def exitfunc(): # reliably restored by inspect """ run any registered exit functions @@ -215,12 +210,10 @@ def exitfunc(): # reliably restored by inspect """ pass - def getcheckinterval(): # real signature unknown; restored from __doc__ """ getcheckinterval() -> current check interval; see setcheckinterval(). """ pass - def getdefaultencoding(): # real signature unknown; restored from __doc__ """ getdefaultencoding() -> string @@ -230,7 +223,6 @@ def getdefaultencoding(): # real signature unknown; restored from __doc__ """ return "" - def getdlopenflags(): # real signature unknown; restored from __doc__ """ getdlopenflags() -> int @@ -240,7 +232,6 @@ def getdlopenflags(): # real signature unknown; restored from __doc__ """ return 0 - def getfilesystemencoding(): # real signature unknown; restored from __doc__ """ getfilesystemencoding() -> string @@ -250,7 +241,6 @@ def getfilesystemencoding(): # real signature unknown; restored from __doc__ """ return "" - def getprofile(): # real signature unknown; restored from __doc__ """ getprofile() @@ -260,7 +250,6 @@ def getprofile(): # real signature unknown; restored from __doc__ """ pass - def getrecursionlimit(): # real signature unknown; restored from __doc__ """ getrecursionlimit() @@ -271,7 +260,6 @@ def getrecursionlimit(): # real signature unknown; restored from __doc__ """ pass - def getrefcount(p_object): # real signature unknown; restored from __doc__ """ getrefcount(object) -> integer @@ -282,7 +270,6 @@ def getrefcount(p_object): # real signature unknown; restored from __doc__ """ return 0 - def getsizeof(p_object, default): # real signature unknown; restored from __doc__ """ getsizeof(object, default) -> int @@ -291,7 +278,6 @@ def getsizeof(p_object, default): # real signature unknown; restored from __doc_ """ return 0 - def gettrace(): # real signature unknown; restored from __doc__ """ gettrace() @@ -301,7 +287,6 @@ def gettrace(): # real signature unknown; restored from __doc__ """ pass - def setcheckinterval(n): # real signature unknown; restored from __doc__ """ setcheckinterval(n) @@ -311,7 +296,6 @@ def setcheckinterval(n): # real signature unknown; restored from __doc__ """ pass - def setdlopenflags(n): # real signature unknown; restored from __doc__ """ setdlopenflags(n) -> None @@ -327,7 +311,6 @@ def setdlopenflags(n): # real signature unknown; restored from __doc__ """ pass - def setprofile(function): # real signature unknown; restored from __doc__ """ setprofile(function) @@ -337,7 +320,6 @@ def setprofile(function): # real signature unknown; restored from __doc__ """ pass - def setrecursionlimit(n): # real signature unknown; restored from __doc__ """ setrecursionlimit(n) @@ -349,7 +331,6 @@ def setrecursionlimit(n): # real signature unknown; restored from __doc__ """ pass - def settrace(function): # real signature unknown; restored from __doc__ """ settrace(function) @@ -359,7 +340,6 @@ def settrace(function): # real signature unknown; restored from __doc__ """ pass - def _clear_type_cache(): # real signature unknown; restored from __doc__ """ _clear_type_cache() -> None @@ -367,7 +347,6 @@ def _clear_type_cache(): # real signature unknown; restored from __doc__ """ pass - def _current_frames(): # real signature unknown; restored from __doc__ """ _current_frames() -> dictionary @@ -379,7 +358,6 @@ def _current_frames(): # real signature unknown; restored from __doc__ """ return {} - def _getframe(depth=None): # real signature unknown; restored from __doc__ """ _getframe([depth]) -> frameobject @@ -394,7 +372,6 @@ def _getframe(depth=None): # real signature unknown; restored from __doc__ """ pass - def __displayhook__(*args, **kwargs): # real signature unknown """ displayhook(object) -> None @@ -403,7 +380,6 @@ def __displayhook__(*args, **kwargs): # real signature unknown """ pass - def __excepthook__(*args, **kwargs): # real signature unknown """ excepthook(exctype, value, traceback) -> None @@ -412,7 +388,6 @@ def __excepthook__(*args, **kwargs): # real signature unknown """ pass - # no classes # variables with complex values @@ -431,28 +406,22 @@ meta_path = [] modules = {} # real value of type skipped path = [ - '/home/user/src/idea/out/classes/production/python-helpers', - '/usr/local/lib/python2.7/dist-packages/distribute-0.6.27-py2.7.egg', - '/usr/lib/python2.7', - '/usr/lib/python2.7/plat-linux2', - '/usr/lib/python2.7/lib-tk', - '/usr/lib/python2.7/lib-old', - '/usr/lib/python2.7/lib-dynload', - '/home/user/.local/lib/python2.7/site-packages', - '/usr/local/lib/python2.7/dist-packages', - '/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg-info', - '/usr/lib/python2.7/dist-packages', - '/usr/lib/python2.7/dist-packages/PIL', - '/usr/lib/python2.7/dist-packages/gst-0.10', - '/usr/lib/python2.7/dist-packages/gtk-2.0', - '/usr/lib/pymodules/python2.7', - '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', - '/usr/lib/python2.7/dist-packages/ubuntuone-client', - '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', - '/usr/lib/python2.7/dist-packages/ubuntuone-couch', - '/usr/lib/python2.7/dist-packages/ubuntuone-installer', - '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol', - '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode', + '/Users/vlan/src/idea/out/classes/production/python-helpers', + '/Users/vlan/.virtualenvs/obraz-py2.7/lib/python27.zip', + '/Users/vlan/.virtualenvs/obraz-py2.7/lib/python2.7', + '/Users/vlan/.virtualenvs/obraz-py2.7/lib/python2.7/plat-darwin', + '/Users/vlan/.virtualenvs/obraz-py2.7/lib/python2.7/plat-mac', + '/Users/vlan/.virtualenvs/obraz-py2.7/lib/python2.7/plat-mac/lib-scriptpackages', + '/Users/vlan/.virtualenvs/obraz-py2.7/Extras/lib/python', + '/Users/vlan/.virtualenvs/obraz-py2.7/lib/python2.7/lib-tk', + '/Users/vlan/.virtualenvs/obraz-py2.7/lib/python2.7/lib-old', + '/Users/vlan/.virtualenvs/obraz-py2.7/lib/python2.7/lib-dynload', + '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', + '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', + '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', + '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', + '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', + '/Users/vlan/.virtualenvs/obraz-py2.7/lib/python2.7/site-packages', ] path_hooks = [ diff --git a/python/testData/MockSdk3.4/python_stubs/_io.py b/python/testData/MockSdk3.4/python_stubs/_io.py index 214d63caec65..868bcb114d8a 100644 --- a/python/testData/MockSdk3.4/python_stubs/_io.py +++ b/python/testData/MockSdk3.4/python_stubs/_io.py @@ -1,7 +1,7 @@ # encoding: utf-8 # module _io calls itself io # from (built-in) -# by generator 1.135 +# by generator 1.138 """ The io module provides the Python interfaces to stream handling. The builtin open function is defined in this module. @@ -173,16 +173,12 @@ def open(name, mode=None, buffering=None): # known case of _io.open # classes -from .OSError import OSError - class BlockingIOError(OSError): """ I/O operation would block. """ def __init__(self, *args, **kwargs): # real signature unknown pass -from .object import object - class _IOBase(object): """ The abstract base class for all I/O classes, acting on streams of @@ -370,8 +366,6 @@ class _IOBase(object): __dict__ = None # (!) real value is '' -from ._IOBase import _IOBase - class _BufferedIOBase(_IOBase): """ Base class for buffered IO objects. @@ -447,8 +441,6 @@ class _BufferedIOBase(_IOBase): pass -from ._BufferedIOBase import _BufferedIOBase - class BufferedRandom(_BufferedIOBase): """ A buffered interface to random access streams. @@ -545,8 +537,6 @@ class BufferedRandom(_BufferedIOBase): -from ._BufferedIOBase import _BufferedIOBase - class BufferedReader(_BufferedIOBase): """ Create a new buffered reader using the given readable raw IO object. """ def close(self, *args, **kwargs): # real signature unknown @@ -634,8 +624,6 @@ class BufferedReader(_BufferedIOBase): -from ._BufferedIOBase import _BufferedIOBase - class BufferedRWPair(_BufferedIOBase): """ A buffered reader and writer object together. @@ -693,8 +681,6 @@ class BufferedRWPair(_BufferedIOBase): -from ._BufferedIOBase import _BufferedIOBase - class BufferedWriter(_BufferedIOBase): """ A buffer for a writeable sequential RawIO object. @@ -772,8 +758,6 @@ class BufferedWriter(_BufferedIOBase): -from ._BufferedIOBase import _BufferedIOBase - class BytesIO(_BufferedIOBase): """ BytesIO([buffer]) -> object @@ -946,8 +930,6 @@ class BytesIO(_BufferedIOBase): -from ._IOBase import _IOBase - class _RawIOBase(_IOBase): """ Base class for raw binary I/O. """ def read(self, *args, **kwargs): # real signature unknown @@ -961,8 +943,6 @@ class _RawIOBase(_IOBase): pass -from ._RawIOBase import _RawIOBase - class FileIO(_RawIOBase): """ file(name: str[, mode: str][, opener: None]) -> file IO object @@ -1104,8 +1084,6 @@ class FileIO(_RawIOBase): -from .object import object - class IncrementalNewlineDecoder(object): """ Codec used when reading a file in universal newlines mode. It wraps @@ -1140,8 +1118,6 @@ class IncrementalNewlineDecoder(object): -from ._IOBase import _IOBase - class _TextIOBase(_IOBase): """ Base class for text I/O. @@ -1209,8 +1185,6 @@ Subclasses should override. -from ._TextIOBase import _TextIOBase - class StringIO(_TextIOBase): """ Text I/O implementation using an in-memory buffer. @@ -1321,8 +1295,6 @@ class StringIO(_TextIOBase): -from ._TextIOBase import _TextIOBase - class TextIOWrapper(_TextIOBase): """ Character and line based layer over a BufferedIOBase object, buffer. @@ -1435,10 +1407,6 @@ class TextIOWrapper(_TextIOBase): -from .ValueError import ValueError - -from .OSError import OSError - class UnsupportedOperation(ValueError, OSError): # no doc def __init__(self, *args, **kwargs): # real signature unknown @@ -1449,8 +1417,6 @@ class UnsupportedOperation(ValueError, OSError): -from .object import object - class __loader__(object): """ Meta path import for built-in modules. diff --git a/python/testData/MockSdk3.4/python_stubs/builtins.py b/python/testData/MockSdk3.4/python_stubs/builtins.py index 7309cbaf3c66..08bc4211384d 100644 --- a/python/testData/MockSdk3.4/python_stubs/builtins.py +++ b/python/testData/MockSdk3.4/python_stubs/builtins.py @@ -1,7 +1,7 @@ # encoding: utf-8 # module builtins # from (built-in) -# by generator 1.137 +# by generator 1.138 """ Built-in functions, exceptions, and other objects. @@ -473,7 +473,7 @@ def pow(*args, **kwargs): # real signature unknown """ pass -def print(*args, sep=' ', end='\n', file=None): # known special case of print +def print(self, *args, sep=' ', end='\n', file=None): # known special case of print """ print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False) @@ -4675,7 +4675,7 @@ class str(object): """ return 0 - def format(*args, **kwargs): # known special case of str.format + def format(self, *args, **kwargs): # known special case of str.format """ S.format(*args, **kwargs) -> str diff --git a/python/testData/MockSdk3.4/python_stubs/sys.py b/python/testData/MockSdk3.4/python_stubs/sys.py index a64198bc33fa..d9ded608eeb6 100644 --- a/python/testData/MockSdk3.4/python_stubs/sys.py +++ b/python/testData/MockSdk3.4/python_stubs/sys.py @@ -1,7 +1,7 @@ # encoding: utf-8 # module sys # from (built-in) -# by generator 1.135 +# by generator 1.138 """ This module provides access to some objects used or maintained by the interpreter and to functions that interact strongly with the interpreter. @@ -48,8 +48,6 @@ prefix -- prefix used to find the Python library thread_info -- a struct sequence with information about the thread implementation. version -- the version of this interpreter as a string version_info -- version information as a named tuple -dllhandle -- [Windows only] integer handle of the Python DLL -winver -- [Windows only] version number of the Python DLL __stdin__ -- the original stdin; don't touch! __stdout__ -- the original stdout; don't touch! __stderr__ -- the original stderr; don't touch! @@ -78,42 +76,40 @@ settrace() -- set the global debug tracing function # Variables with simple values +abiflags = 'm' + api_version = 1013 -base_exec_prefix = 'C:\\Python34' +base_exec_prefix = '/Library/Frameworks/Python.framework/Versions/3.4' -base_prefix = 'C:\\Python34' +base_prefix = '/Library/Frameworks/Python.framework/Versions/3.4' byteorder = 'little' copyright = 'Copyright (c) 2001-2014 Python Software Foundation.\nAll Rights Reserved.\n\nCopyright (c) 2000 BeOpen.com.\nAll Rights Reserved.\n\nCopyright (c) 1995-2001 Corporation for National Research Initiatives.\nAll Rights Reserved.\n\nCopyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\nAll Rights Reserved.' -dllhandle = 1705771008 +dont_write_bytecode = True -dont_write_bytecode = False +executable = '/Users/vlan/.virtualenvs/obraz-py3.4/bin/python' -executable = 'C:\\Python34\\python.exe' - -exec_prefix = 'C:\\Python34' +exec_prefix = '/Users/vlan/.virtualenvs/obraz-py3.4' float_repr_style = 'short' -hexversion = 50594288 +hexversion = 50594544 -maxsize = 2147483647 +maxsize = 9223372036854775807 maxunicode = 1114111 -platform = 'win32' +platform = 'darwin' -prefix = 'C:\\Python34' +prefix = '/Users/vlan/.virtualenvs/obraz-py3.4' -version = '3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (Intel)]' +version = '3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) \n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]' -winver = '3.4' +_home = '/Library/Frameworks/Python.framework/Versions/3.4/bin' -_home = None - -__egginsert = 1 +__egginsert = 0 __plen = 5 # functions @@ -212,6 +208,15 @@ def getdefaultencoding(): # real signature unknown; restored from __doc__ """ return "" +def getdlopenflags(): # real signature unknown; restored from __doc__ + """ + getdlopenflags() -> int + + Return the current value of the flags that are used for dlopen calls. + The flag constants are defined in the os module. + """ + return 0 + def getfilesystemencoding(): # real signature unknown; restored from __doc__ """ getfilesystemencoding() -> string @@ -271,21 +276,6 @@ def gettrace(): # real signature unknown; restored from __doc__ """ pass -def getwindowsversion(): # real signature unknown; restored from __doc__ - """ - getwindowsversion() - - Return information about the running version of Windows as a named tuple. - The members are named: major, minor, build, platform, service_pack, - service_pack_major, service_pack_minor, suite_mask, and product_type. For - backward compatibility, only the first 5 items are available by indexing. - All elements are numbers, except service_pack which is a string. Platform - may be 0 for win32s, 1 for Windows 9x/ME, 2 for Windows NT/2000/XP/Vista/7, - 3 for Windows CE. Product_type may be 1 for a workstation, 2 for a domain - controller, 3 for a server. - """ - pass - def intern(string): # real signature unknown; restored from __doc__ """ intern(string) -> string @@ -306,6 +296,19 @@ def setcheckinterval(n): # real signature unknown; restored from __doc__ """ pass +def setdlopenflags(n): # real signature unknown; restored from __doc__ + """ + setdlopenflags(n) -> None + + Set the flags used by the interpreter for dlopen calls, such as when the + interpreter loads extension modules. Among other things, this will enable + a lazy resolving of symbols when importing a module, if called as + sys.setdlopenflags(0). To share symbols across extension modules, call as + sys.setdlopenflags(os.RTLD_GLOBAL). Symbolic names for the flag modules + can be found in the os module (RTLD_xxx constants, e.g. os.RTLD_LAZY). + """ + pass + def setprofile(function): # real signature unknown; restored from __doc__ """ setprofile(function) @@ -415,8 +418,6 @@ def __interactivehook__(): # reliably restored by inspect # classes -from .object import object - class __loader__(object): """ Meta path import for built-in modules. @@ -488,7 +489,7 @@ flags = ( 0, 0, 0, - 0, + 1, 0, 0, 0, @@ -514,8 +515,8 @@ float_info = ( ) hash_info = ( - 32, - 2147483647, + 64, + 2305843009213693951, 314159, 0, 1000003, @@ -528,27 +529,25 @@ hash_info = ( implementation = None # (!) real value is '' int_info = ( - 15, - 2, + 30, + 4, ) meta_path = [ __loader__, None, # (!) real value is '' None, # (!) real value is '' - None, # (!) real value is '' ] modules = {} # real value of type skipped path = [ - 'C:\\work\\ultimate\\out\\classes\\production\\python-helpers', - 'C:\\Python34\\lib\\site-packages\\setuptools-4.0.1-py3.4.egg', - 'C:\\Windows\\system32\\python34.zip', - 'C:\\Python34\\DLLs', - 'C:\\Python34\\lib', - 'C:\\Python34', - 'C:\\Python34\\lib\\site-packages', + '/Users/vlan/src/idea/out/classes/production/python-helpers', + '/Library/Frameworks/Python.framework/Versions/3.4/lib/python34.zip', + '/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4', + '/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/plat-darwin', + '/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload', + '/Users/vlan/.virtualenvs/obraz-py3.4/lib/python3.4/site-packages', ] path_hooks = [ @@ -558,22 +557,22 @@ path_hooks = [ path_importer_cache = {} # real value of type skipped -stderr = None # (!) real value is '' +stderr = None # (!) forward: __stderr__, real value is '' -stdin = None # (!) real value is '' +stdin = None # (!) forward: __stdin__, real value is '' -stdout = None # (!) real value is '' +stdout = None # (!) forward: __stdout__, real value is '' thread_info = ( - 'nt', - None, + 'pthread', + 'mutex+cond', None, ) version_info = ( 3, 4, - 1, + 2, 'final', 0, ) @@ -582,19 +581,19 @@ warnoptions = [] _mercurial = ( 'CPython', - 'v3.4.1', - 'c0e311e010fc', + 'v3.4.2', + 'ab2c023a9432', ) _xoptions = {} __spec__ = None # (!) real value is '' -__stderr__ = stderr +__stderr__ = None # (!) real value is '' -__stdin__ = stdin +__stdin__ = None # (!) real value is '' -__stdout__ = stdout +__stdout__ = None # (!) real value is '' # intermittent names exc_value = Exception() diff --git a/python/testData/inspections/PyArgumentListInspection/strFormat.py b/python/testData/inspections/PyArgumentListInspection/strFormat.py new file mode 100644 index 000000000000..e04a0c7b9b51 --- /dev/null +++ b/python/testData/inspections/PyArgumentListInspection/strFormat.py @@ -0,0 +1,2 @@ +b'{foo}'.format(foo=0) +u'{foo}'.format(foo=0) diff --git a/python/testData/inspections/PyTypeCheckerInspection/StrFormat.py b/python/testData/inspections/PyTypeCheckerInspection/StrFormat.py new file mode 100644 index 000000000000..4a076842aa86 --- /dev/null +++ b/python/testData/inspections/PyTypeCheckerInspection/StrFormat.py @@ -0,0 +1,2 @@ +b'{}'.format(0) +u'{}'.format(0) diff --git a/python/testData/inspections/PyTypeCheckerInspection/StrFormatPy3.py b/python/testData/inspections/PyTypeCheckerInspection/StrFormatPy3.py new file mode 100644 index 000000000000..a39a7ca65145 --- /dev/null +++ b/python/testData/inspections/PyTypeCheckerInspection/StrFormatPy3.py @@ -0,0 +1 @@ +'{}'.format(0) diff --git a/python/testSrc/com/jetbrains/python/inspections/Py3TypeCheckerInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/Py3TypeCheckerInspectionTest.java index 7e75e0afb901..2c2b94f4e745 100644 --- a/python/testSrc/com/jetbrains/python/inspections/Py3TypeCheckerInspectionTest.java +++ b/python/testSrc/com/jetbrains/python/inspections/Py3TypeCheckerInspectionTest.java @@ -93,4 +93,9 @@ public class Py3TypeCheckerInspectionTest extends PyTestCase { public void testAsyncForIterable() { doTest(); } + + // PY-18275 + public void testStrFormatPy3() { + doTest(); + } } diff --git a/python/testSrc/com/jetbrains/python/inspections/PyArgumentListInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyArgumentListInspectionTest.java index 698c64e51803..d2f9ff6ee574 100644 --- a/python/testSrc/com/jetbrains/python/inspections/PyArgumentListInspectionTest.java +++ b/python/testSrc/com/jetbrains/python/inspections/PyArgumentListInspectionTest.java @@ -190,4 +190,9 @@ public class PyArgumentListInspectionTest extends PyTestCase { public void testUnionTypeAttributeCall() { doTest(); } + + // PY-18275 + public void testStrFormat() { + doTest(); + } } diff --git a/python/testSrc/com/jetbrains/python/inspections/PyTypeCheckerInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyTypeCheckerInspectionTest.java index 3418953447b9..c8d2a222a9ab 100644 --- a/python/testSrc/com/jetbrains/python/inspections/PyTypeCheckerInspectionTest.java +++ b/python/testSrc/com/jetbrains/python/inspections/PyTypeCheckerInspectionTest.java @@ -275,4 +275,9 @@ public class PyTypeCheckerInspectionTest extends PyTestCase { public void testClassNew() { doTest(); } + + // PY-18275 + public void testStrFormat() { + doTest(); + } }