diff -r 0ae768637a07 Include/object.h --- a/Include/object.h Sat Jan 25 22:19:47 2014 -0800 +++ b/Include/object.h Sun Jan 26 04:31:05 2014 -0800 @@ -493,10 +493,8 @@ PyAPI_FUNC(void) PyType_Modified(PyTypeObject *); #ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) -_PyType_GetDocFromInternalDoc(const char *, const char *); -PyAPI_FUNC(PyObject *) -_PyType_GetTextSignatureFromInternalDoc(const char *, const char *); +PyAPI_FUNC(PyObject *) _PyType_GetDocFromInternalDoc(const char *); +PyAPI_FUNC(PyObject *) _PyType_GetTextSignatureFromInternalDoc(const char *); #endif /* Generic operations on objects */ diff -r 0ae768637a07 Lib/idlelib/idle_test/test_calltips.py --- a/Lib/idlelib/idle_test/test_calltips.py Sat Jan 25 22:19:47 2014 -0800 +++ b/Lib/idlelib/idle_test/test_calltips.py Sun Jan 26 04:31:05 2014 -0800 @@ -61,21 +61,22 @@ gtest([].append, append_doc) gtest(List.append, append_doc) - gtest(types.MethodType, "Create a bound instance method object.") + gtest(types.MethodType, "method(function, instance)") gtest(SB(), default_tip) def test_multiline_docstring(self): # Test fewer lines than max. self.assertEqual(signature(dict), + "dict() -> new empty dictionary\n" "dict(mapping) -> new dictionary initialized from a mapping object's\n" "(key, value) pairs\n" "dict(iterable) -> new dictionary initialized as if via:\n" - "d = {}\n" - "for k, v in iterable:" + "d = {}" ) # Test max lines and line (currently) too long. self.assertEqual(signature(bytes), +"bytes(iterable_of_ints) -> bytes\n" "bytes(string, encoding[, errors]) -> bytes\n" "bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\n" #bytes(int) -> bytes object of size given by the parameter initialized with null bytes diff -r 0ae768637a07 Lib/inspect.py --- a/Lib/inspect.py Sat Jan 25 22:19:47 2014 -0800 +++ b/Lib/inspect.py Sun Jan 26 04:31:05 2014 -0800 @@ -1967,6 +1967,10 @@ else: kind = Parameter.POSITIONAL_OR_KEYWORD + first_parameter_is_self = s.startswith("($") + if first_parameter_is_self: + s = '(' + s[2:] + s = "def foo" + s + ": pass" try: @@ -2071,18 +2075,11 @@ kind = Parameter.VAR_KEYWORD p(f.args.kwarg, empty) - if parameters and (hasattr(func, '__self__') or - isinstance(func, _WrapperDescriptor,) or - ismethoddescriptor(func) - ): - name = parameters[0].name - if name not in ('self', 'module', 'type'): - pass - elif getattr(func, '__self__', None): - # strip off self (it's already been bound) - p = parameters.pop(0) - if not p.name in ('self', 'module', 'type'): - raise ValueError('Unexpected name ' + repr(p.name) + ', expected self/module/cls/type') + if first_parameter_is_self: + assert parameters + if getattr(func, '__self__', None): + # strip off self, it's already been bound + parameters.pop(0) else: # for builtins, self parameter is always positional-only! p = parameters[0].replace(kind=Parameter.POSITIONAL_ONLY) diff -r 0ae768637a07 Lib/test/test_capi.py --- a/Lib/test/test_capi.py Sat Jan 25 22:19:47 2014 -0800 +++ b/Lib/test/test_capi.py Sun Jan 26 04:31:05 2014 -0800 @@ -125,7 +125,7 @@ self.assertEqual(_testcapi.docstring_no_signature.__text_signature__, None) self.assertEqual(_testcapi.docstring_with_invalid_signature.__doc__, - "docstring_with_invalid_signature (module, boo)\n" + "sig= (module, boo)\n" "\n" "This docstring has an invalid signature." ) diff -r 0ae768637a07 Modules/_cryptmodule.c --- a/Modules/_cryptmodule.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Modules/_cryptmodule.c Sun Jan 26 04:31:05 2014 -0800 @@ -30,7 +30,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(crypt_crypt__doc__, -"crypt(module, word, salt)\n" +"sig=($module, word, salt)\n" "Hash a *word* with the given *salt* and return the hashed password.\n" "\n" "*word* will usually be a user\'s password. *salt* (either a random 2 or 16\n" @@ -63,7 +63,7 @@ static PyObject * crypt_crypt_impl(PyModuleDef *module, const char *word, const char *salt) -/*[clinic end generated code: checksum=dbfe26a21eb335abefe6a0bbd0a682ea22b9adc0]*/ +/*[clinic end generated code: checksum=c7443257e03fca923eabbc2a87e512edc1126240]*/ { /* On some platforms (AtheOS) crypt returns NULL for an invalid salt. Return None in that case. XXX Maybe raise an exception? */ diff -r 0ae768637a07 Modules/_datetimemodule.c --- a/Modules/_datetimemodule.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Modules/_datetimemodule.c Sun Jan 26 04:31:05 2014 -0800 @@ -4159,7 +4159,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(datetime_datetime_now__doc__, -"now(type, tz=None)\n" +"sig=($type, tz=None)\n" "Returns new datetime object representing current time local to tz.\n" "\n" " tz\n" @@ -4192,7 +4192,7 @@ static PyObject * datetime_datetime_now_impl(PyTypeObject *type, PyObject *tz) -/*[clinic end generated code: checksum=a6d3ad2c0ab6389075289af3467f7b8eb13f5f5c]*/ +/*[clinic end generated code: checksum=c8a47308483e579a6e3f5807729c0950180afc16]*/ { PyObject *self; diff -r 0ae768637a07 Modules/_dbmmodule.c --- a/Modules/_dbmmodule.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Modules/_dbmmodule.c Sun Jan 26 04:31:05 2014 -0800 @@ -462,7 +462,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(dbmopen__doc__, -"open(module, filename, flags=\'r\', mode=0o666)\n" +"sig=($module, filename, flags=\'r\', mode=0o666)\n" "Return a database object.\n" "\n" " filename\n" @@ -499,7 +499,7 @@ static PyObject * dbmopen_impl(PyModuleDef *module, const char *filename, const char *flags, int mode) -/*[clinic end generated code: checksum=9efae7d3c3b67a365011bf4e463e918901ba6c79]*/ +/*[clinic end generated code: checksum=a1da6a481d9d332b7af04a8fe3429cb97a38ffbf]*/ { int iflags; diff -r 0ae768637a07 Modules/_pickle.c --- a/Modules/_pickle.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Modules/_pickle.c Sun Jan 26 04:31:05 2014 -0800 @@ -3872,7 +3872,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_Pickler_clear_memo__doc__, -"clear_memo(self)\n" +"sig=($self)\n" "Clears the pickler\'s \"memo\".\n" "\n" "The memo is the data structure that remembers which objects the\n" @@ -3894,7 +3894,7 @@ static PyObject * _pickle_Pickler_clear_memo_impl(PicklerObject *self) -/*[clinic end generated code: checksum=17b1165d8dcae5a2e90b1703bf5cbbfc26114c5a]*/ +/*[clinic end generated code: checksum=7060c44678ce4ec221fa143b0a0af54c5c08fe4e]*/ { if (self->memo) PyMemoTable_Clear(self->memo); @@ -3913,7 +3913,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_Pickler_dump__doc__, -"dump(self, obj)\n" +"sig=($self, obj)\n" "Write a pickled representation of the given object to the open file."); #define _PICKLE_PICKLER_DUMP_METHODDEF \ @@ -3921,7 +3921,7 @@ static PyObject * _pickle_Pickler_dump(PicklerObject *self, PyObject *obj) -/*[clinic end generated code: checksum=36db7f67c8bc05ca6f17b8ab57c54d64bfd0539e]*/ +/*[clinic end generated code: checksum=2dba3729aa7290eede7a9bee62b1dac906b63472]*/ { /* Check whether the Pickler was initialized correctly (issue3664). Developers often forget to call __init__() in their subclasses, which @@ -4025,7 +4025,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_Pickler___init____doc__, -"Pickler(file, protocol=None, fix_imports=True)\n" +"sig=(file, protocol=None, fix_imports=True)\n" "This takes a binary file for writing a pickle data stream.\n" "\n" "The optional *protocol* argument tells the pickler to use the given\n" @@ -4069,7 +4069,7 @@ static int _pickle_Pickler___init___impl(PicklerObject *self, PyObject *file, PyObject *protocol, int fix_imports) -/*[clinic end generated code: checksum=b055bf46cfb5b92c1863302d075246a68bd89153]*/ +/*[clinic end generated code: checksum=474096b033dd65e07fa20574b5f5cd19c3dc2c89]*/ { _Py_IDENTIFIER(persistent_id); _Py_IDENTIFIER(dispatch_table); @@ -4143,7 +4143,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_PicklerMemoProxy_clear__doc__, -"clear(self)\n" +"sig=($self)\n" "Remove all items from memo."); #define _PICKLE_PICKLERMEMOPROXY_CLEAR_METHODDEF \ @@ -4160,7 +4160,7 @@ static PyObject * _pickle_PicklerMemoProxy_clear_impl(PicklerMemoProxyObject *self) -/*[clinic end generated code: checksum=fb4a5ba40918b3eccc9bc1e9d6875cb2737127a9]*/ +/*[clinic end generated code: checksum=df6ef2df4ca2b0f733be36c5d8b89a5aa3a5ef72]*/ { if (self->pickler->memo) PyMemoTable_Clear(self->pickler->memo); @@ -4174,7 +4174,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_PicklerMemoProxy_copy__doc__, -"copy(self)\n" +"sig=($self)\n" "Copy the memo to a new object."); #define _PICKLE_PICKLERMEMOPROXY_COPY_METHODDEF \ @@ -4191,7 +4191,7 @@ static PyObject * _pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self) -/*[clinic end generated code: checksum=3d27d3005725f1828c9a92a38197811c54c64abb]*/ +/*[clinic end generated code: checksum=7d6ed1ed45ed110ce4efd8dd2d93625f01a2bca9]*/ { Py_ssize_t i; PyMemoTable *memo; @@ -4235,7 +4235,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_PicklerMemoProxy___reduce____doc__, -"__reduce__(self)\n" +"sig=($self)\n" "Implement pickle support."); #define _PICKLE_PICKLERMEMOPROXY___REDUCE___METHODDEF \ @@ -4252,7 +4252,7 @@ static PyObject * _pickle_PicklerMemoProxy___reduce___impl(PicklerMemoProxyObject *self) -/*[clinic end generated code: checksum=2682cf8a3a5027def6328419001b086b047d47c8]*/ +/*[clinic end generated code: checksum=26ac4101af84ba1e5c4529764b6744c694a781d4]*/ { PyObject *reduce_value, *dict_args; PyObject *contents = _pickle_PicklerMemoProxy_copy_impl(self); @@ -6274,7 +6274,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_Unpickler_load__doc__, -"load(self)\n" +"sig=($self)\n" "Load a pickle.\n" "\n" "Read a pickled object representation from the open file object given\n" @@ -6295,7 +6295,7 @@ static PyObject * _pickle_Unpickler_load_impl(UnpicklerObject *self) -/*[clinic end generated code: checksum=5ccece694e9898856d916e0a87f0133d4537ebb9]*/ +/*[clinic end generated code: checksum=a1b076fb02cd59d443392ed8144466b80d472f33]*/ { UnpicklerObject *unpickler = (UnpicklerObject*)self; @@ -6337,7 +6337,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_Unpickler_find_class__doc__, -"find_class(self, module_name, global_name)\n" +"sig=($self, module_name, global_name)\n" "Return an object from a specified module.\n" "\n" "If necessary, the module will be imported. Subclasses may override\n" @@ -6372,7 +6372,7 @@ static PyObject * _pickle_Unpickler_find_class_impl(UnpicklerObject *self, PyObject *module_name, PyObject *global_name) -/*[clinic end generated code: checksum=2b8d5398787c8ac7ea5d45f644433169e441003b]*/ +/*[clinic end generated code: checksum=fdd3b50901633ea5386a49e82a7744f47eaec009]*/ { PyObject *global; PyObject *modules_dict; @@ -6554,7 +6554,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_Unpickler___init____doc__, -"Unpickler(file, *, fix_imports=True, encoding=\'ASCII\', errors=\'strict\')\n" +"sig=(file, *, fix_imports=True, encoding=\'ASCII\', errors=\'strict\')\n" "This takes a binary file for reading a pickle data stream.\n" "\n" "The protocol version of the pickle is detected automatically, so no\n" @@ -6601,7 +6601,7 @@ static int _pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file, int fix_imports, const char *encoding, const char *errors) -/*[clinic end generated code: checksum=a8a9dde29eb4ddd538b45099408ea77e01940692]*/ +/*[clinic end generated code: checksum=b3338d6357584fc63c91f63ab488dc98bf4328c8]*/ { _Py_IDENTIFIER(persistent_load); @@ -6669,7 +6669,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_clear__doc__, -"clear(self)\n" +"sig=($self)\n" "Remove all items from memo."); #define _PICKLE_UNPICKLERMEMOPROXY_CLEAR_METHODDEF \ @@ -6686,7 +6686,7 @@ static PyObject * _pickle_UnpicklerMemoProxy_clear_impl(UnpicklerMemoProxyObject *self) -/*[clinic end generated code: checksum=32f6ee47e44405dd587f768f3690d47947bb5a8e]*/ +/*[clinic end generated code: checksum=4b4cb4ca3dd8f2da087690e66f1acca27ed46d52]*/ { _Unpickler_MemoCleanup(self->unpickler); self->unpickler->memo = _Unpickler_NewMemo(self->unpickler->memo_size); @@ -6702,7 +6702,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_copy__doc__, -"copy(self)\n" +"sig=($self)\n" "Copy the memo to a new object."); #define _PICKLE_UNPICKLERMEMOPROXY_COPY_METHODDEF \ @@ -6719,7 +6719,7 @@ static PyObject * _pickle_UnpicklerMemoProxy_copy_impl(UnpicklerMemoProxyObject *self) -/*[clinic end generated code: checksum=ac3da80efc3b2548aa8b5c5358d0e82e615fce1d]*/ +/*[clinic end generated code: checksum=77a284eddb011caf5ce2d0ed6721bf690b6dcef3]*/ { Py_ssize_t i; PyObject *new_memo = PyDict_New(); @@ -6756,7 +6756,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy___reduce____doc__, -"__reduce__(self)\n" +"sig=($self)\n" "Implement pickling support."); #define _PICKLE_UNPICKLERMEMOPROXY___REDUCE___METHODDEF \ @@ -6773,7 +6773,7 @@ static PyObject * _pickle_UnpicklerMemoProxy___reduce___impl(UnpicklerMemoProxyObject *self) -/*[clinic end generated code: checksum=2373102b7c87d99ba4c4a56b6813d2c84dd61865]*/ +/*[clinic end generated code: checksum=f50c52c995333dd26609fcb87a40b2f13c53d1a3]*/ { PyObject *reduce_value; PyObject *constructor_args; @@ -7082,7 +7082,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_dump__doc__, -"dump(module, obj, file, protocol=None, *, fix_imports=True)\n" +"sig=($module, obj, file, protocol=None, *, fix_imports=True)\n" "Write a pickled representation of obj to the open file object file.\n" "\n" "This is equivalent to ``Pickler(file, protocol).dump(obj)``, but may\n" @@ -7133,7 +7133,7 @@ static PyObject * _pickle_dump_impl(PyModuleDef *module, PyObject *obj, PyObject *file, PyObject *protocol, int fix_imports) -/*[clinic end generated code: checksum=1d4ff873e13eb840ff275d716d8d4c5554af087c]*/ +/*[clinic end generated code: checksum=18dfcea514b9be1c1d166b8cdeb10c089d70fcb4]*/ { PicklerObject *pickler = _Pickler_New(); @@ -7185,7 +7185,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_dumps__doc__, -"dumps(module, obj, protocol=None, *, fix_imports=True)\n" +"sig=($module, obj, protocol=None, *, fix_imports=True)\n" "Return the pickled representation of the object as a bytes object.\n" "\n" "The optional *protocol* argument tells the pickler to use the given\n" @@ -7227,7 +7227,7 @@ static PyObject * _pickle_dumps_impl(PyModuleDef *module, PyObject *obj, PyObject *protocol, int fix_imports) -/*[clinic end generated code: checksum=9c6c0291ef2d2b0856b7d4caecdcb7bad13a23b3]*/ +/*[clinic end generated code: checksum=df19b300b3a4a79c4e05bc4c07e854c12e2f4e3e]*/ { PyObject *result; PicklerObject *pickler = _Pickler_New(); @@ -7286,7 +7286,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_load__doc__, -"load(module, file, *, fix_imports=True, encoding=\'ASCII\', errors=\'strict\')\n" +"sig=($module, file, *, fix_imports=True, encoding=\'ASCII\', errors=\'strict\')\n" "Read and return an object from the pickle data stored in a file.\n" "\n" "This is equivalent to ``Unpickler(file).load()``, but may be more\n" @@ -7339,7 +7339,7 @@ static PyObject * _pickle_load_impl(PyModuleDef *module, PyObject *file, int fix_imports, const char *encoding, const char *errors) -/*[clinic end generated code: checksum=2b5b7e5e3a836cf1c53377ce9274a84a8bceef67]*/ +/*[clinic end generated code: checksum=be9b9f60420955a4ea023ec54c19b24d59b5a1e8]*/ { PyObject *result; UnpicklerObject *unpickler = _Unpickler_New(); @@ -7391,7 +7391,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_pickle_loads__doc__, -"loads(module, data, *, fix_imports=True, encoding=\'ASCII\', errors=\'strict\')\n" +"sig=($module, data, *, fix_imports=True, encoding=\'ASCII\', errors=\'strict\')\n" "Read and return an object from the given pickle data.\n" "\n" "The protocol version of the pickle is detected automatically, so no\n" @@ -7435,7 +7435,7 @@ static PyObject * _pickle_loads_impl(PyModuleDef *module, PyObject *data, int fix_imports, const char *encoding, const char *errors) -/*[clinic end generated code: checksum=7b21a75997c8f6636e4bf48c663b28f2bfd4eb6a]*/ +/*[clinic end generated code: checksum=057814d5276d9a26a6fe0c889221c84e38215011]*/ { PyObject *result; UnpicklerObject *unpickler = _Unpickler_New(); diff -r 0ae768637a07 Modules/_sre.c --- a/Modules/_sre.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Modules/_sre.c Sun Jan 26 04:31:05 2014 -0800 @@ -540,7 +540,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(pattern_match__doc__, -"match(self, pattern, pos=0, endpos=sys.maxsize)\n" +"sig=($self, pattern, pos=0, endpos=sys.maxsize)\n" "Matches zero or more characters at the beginning of the string."); #define PATTERN_MATCH_METHODDEF \ @@ -570,7 +570,7 @@ static PyObject * pattern_match_impl(PatternObject *self, PyObject *pattern, Py_ssize_t pos, Py_ssize_t endpos) -/*[clinic end generated code: checksum=4a3865d13638cb7c13dcae1fe58c1a9c35071998]*/ +/*[clinic end generated code: checksum=9f5b785661677848d19bf5e00302205fd8da03cd]*/ { SRE_STATE state; Py_ssize_t status; diff -r 0ae768637a07 Modules/_testcapimodule.c --- a/Modules/_testcapimodule.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Modules/_testcapimodule.c Sun Jan 26 04:31:05 2014 -0800 @@ -2851,18 +2851,18 @@ ); PyDoc_STRVAR(docstring_with_invalid_signature, -"docstring_with_invalid_signature (module, boo)\n" +"sig= (module, boo)\n" "\n" "This docstring has an invalid signature." ); PyDoc_STRVAR(docstring_with_signature, -"docstring_with_signature(module, sig)\n" +"sig=(module, sig)\n" "This docstring has a valid signature." ); PyDoc_STRVAR(docstring_with_signature_and_extra_newlines, -"docstring_with_signature_and_extra_newlines(module, parameter)\n" +"sig=(module, parameter)\n" "\n" "\n" "\n" @@ -2870,7 +2870,7 @@ ); PyDoc_STRVAR(docstring_with_signature_with_defaults, -"docstring_with_signature_with_defaults(module, s='avocado', b=b'bytes', d=3.14, i=35, n=None, t=True, f=False, local=the_number_three, sys=sys.maxsize, exp=sys.maxsize - 1)\n" +"sig=(module, s='avocado', b=b'bytes', d=3.14, i=35, n=None, t=True, f=False, local=the_number_three, sys=sys.maxsize, exp=sys.maxsize - 1)\n" "\n" "\n" "\n" diff -r 0ae768637a07 Modules/_weakref.c --- a/Modules/_weakref.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Modules/_weakref.c Sun Jan 26 04:31:05 2014 -0800 @@ -20,7 +20,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_weakref_getweakrefcount__doc__, -"getweakrefcount(module, object)\n" +"sig=($module, object)\n" "Return the number of weak references to \'object\'."); #define _WEAKREF_GETWEAKREFCOUNT_METHODDEF \ @@ -46,7 +46,7 @@ static Py_ssize_t _weakref_getweakrefcount_impl(PyModuleDef *module, PyObject *object) -/*[clinic end generated code: checksum=dd8ba0730babf263d3db78d260ea7eacf6eb3735]*/ +/*[clinic end generated code: checksum=ef51baac56180816d0d073db4da22ff2dd760adf]*/ { PyWeakReference **list; diff -r 0ae768637a07 Modules/clinic/_bz2module.c.h --- a/Modules/clinic/_bz2module.c.h Sat Jan 25 22:19:47 2014 -0800 +++ b/Modules/clinic/_bz2module.c.h Sun Jan 26 04:31:05 2014 -0800 @@ -3,7 +3,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_bz2_BZ2Compressor_compress__doc__, -"compress(self, data)\n" +"sig=($self, data)\n" "Provide data to the compressor object.\n" "\n" "Returns a chunk of compressed data if possible, or b\'\' otherwise.\n" @@ -38,7 +38,7 @@ } PyDoc_STRVAR(_bz2_BZ2Compressor_flush__doc__, -"flush(self)\n" +"sig=($self)\n" "Finish the compression process.\n" "\n" "Returns the compressed data left in internal buffers.\n" @@ -58,7 +58,7 @@ } PyDoc_STRVAR(_bz2_BZ2Compressor___init____doc__, -"BZ2Compressor(compresslevel=9)\n" +"sig=(compresslevel=9)\n" "Create a compressor object for compressing data incrementally.\n" "\n" " compresslevel\n" @@ -89,7 +89,7 @@ } PyDoc_STRVAR(_bz2_BZ2Decompressor_decompress__doc__, -"decompress(self, data)\n" +"sig=($self, data)\n" "Provide data to the decompressor object.\n" "\n" "Returns a chunk of decompressed data if possible, or b\'\' otherwise.\n" @@ -125,7 +125,7 @@ } PyDoc_STRVAR(_bz2_BZ2Decompressor___init____doc__, -"BZ2Decompressor()\n" +"sig=()\n" "Create a decompressor object for decompressing data incrementally.\n" "\n" "For one-shot decompression, use the decompress() function instead."); @@ -149,4 +149,4 @@ exit: return return_value; } -/*[clinic end generated code: checksum=4ade1dba3921a8bd8a614e5417f7654d8fb10be5]*/ +/*[clinic end generated code: checksum=aca4f6329c1c773a7f1f73422f0025cd2f5dda12]*/ diff -r 0ae768637a07 Modules/clinic/_lzmamodule.c.h --- a/Modules/clinic/_lzmamodule.c.h Sat Jan 25 22:19:47 2014 -0800 +++ b/Modules/clinic/_lzmamodule.c.h Sun Jan 26 04:31:05 2014 -0800 @@ -3,7 +3,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_lzma_LZMACompressor_compress__doc__, -"compress(self, data)\n" +"sig=($self, data)\n" "Provide data to the compressor object.\n" "\n" "Returns a chunk of compressed data if possible, or b\'\' otherwise.\n" @@ -38,7 +38,7 @@ } PyDoc_STRVAR(_lzma_LZMACompressor_flush__doc__, -"flush(self)\n" +"sig=($self)\n" "Finish the compression process.\n" "\n" "Returns the compressed data left in internal buffers.\n" @@ -58,7 +58,7 @@ } PyDoc_STRVAR(_lzma_LZMADecompressor_decompress__doc__, -"decompress(self, data)\n" +"sig=($self, data)\n" "Provide data to the decompressor object.\n" "\n" "Returns a chunk of decompressed data if possible, or b\'\' otherwise.\n" @@ -94,7 +94,7 @@ } PyDoc_STRVAR(_lzma_LZMADecompressor___init____doc__, -"LZMADecompressor(format=FORMAT_AUTO, memlimit=None, filters=None)\n" +"sig=(format=FORMAT_AUTO, memlimit=None, filters=None)\n" "Create a decompressor object for decompressing data incrementally.\n" "\n" " format\n" @@ -137,7 +137,7 @@ } PyDoc_STRVAR(_lzma_is_check_supported__doc__, -"is_check_supported(module, check_id)\n" +"sig=($module, check_id)\n" "Test whether the given integrity check is supported.\n" "\n" "Always returns True for CHECK_NONE and CHECK_CRC32."); @@ -165,7 +165,7 @@ } PyDoc_STRVAR(_lzma__encode_filter_properties__doc__, -"_encode_filter_properties(module, filter)\n" +"sig=($module, filter)\n" "Return a bytes object encoding the options (properties) of the filter specified by *filter* (a dict).\n" "\n" "The result does not include the filter ID itself, only the options."); @@ -197,7 +197,7 @@ } PyDoc_STRVAR(_lzma__decode_filter_properties__doc__, -"_decode_filter_properties(module, filter_id, encoded_props)\n" +"sig=($module, filter_id, encoded_props)\n" "Return a bytes object encoding the options (properties) of the filter specified by *filter* (a dict).\n" "\n" "The result does not include the filter ID itself, only the options."); @@ -228,4 +228,4 @@ return return_value; } -/*[clinic end generated code: checksum=b4b90dcbd0c9c349c3a94e26a7eecf71aab179a0]*/ +/*[clinic end generated code: checksum=fe63bc798a5c5c55124b4d58efe5fc33b724c823]*/ diff -r 0ae768637a07 Modules/clinic/audioop.c.h --- a/Modules/clinic/audioop.c.h Sat Jan 25 22:19:47 2014 -0800 +++ b/Modules/clinic/audioop.c.h Sun Jan 26 04:31:05 2014 -0800 @@ -3,7 +3,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(audioop_getsample__doc__, -"getsample(module, fragment, width, index)\n" +"sig=($module, fragment, width, index)\n" "Return the value of sample index from the fragment."); #define AUDIOOP_GETSAMPLE_METHODDEF \ @@ -35,7 +35,7 @@ } PyDoc_STRVAR(audioop_max__doc__, -"max(module, fragment, width)\n" +"sig=($module, fragment, width)\n" "Return the maximum of the absolute value of all samples in a fragment."); #define AUDIOOP_MAX_METHODDEF \ @@ -66,7 +66,7 @@ } PyDoc_STRVAR(audioop_minmax__doc__, -"minmax(module, fragment, width)\n" +"sig=($module, fragment, width)\n" "Return the minimum and maximum values of all samples in the sound fragment."); #define AUDIOOP_MINMAX_METHODDEF \ @@ -97,7 +97,7 @@ } PyDoc_STRVAR(audioop_avg__doc__, -"avg(module, fragment, width)\n" +"sig=($module, fragment, width)\n" "Return the average over all samples in the fragment."); #define AUDIOOP_AVG_METHODDEF \ @@ -128,7 +128,7 @@ } PyDoc_STRVAR(audioop_rms__doc__, -"rms(module, fragment, width)\n" +"sig=($module, fragment, width)\n" "Return the root-mean-square of the fragment, i.e. sqrt(sum(S_i^2)/n)."); #define AUDIOOP_RMS_METHODDEF \ @@ -159,7 +159,7 @@ } PyDoc_STRVAR(audioop_findfit__doc__, -"findfit(module, fragment, reference)\n" +"sig=($module, fragment, reference)\n" "Try to match reference as well as possible to a portion of fragment."); #define AUDIOOP_FINDFIT_METHODDEF \ @@ -193,7 +193,7 @@ } PyDoc_STRVAR(audioop_findfactor__doc__, -"findfactor(module, fragment, reference)\n" +"sig=($module, fragment, reference)\n" "Return a factor F such that rms(add(fragment, mul(reference, -F))) is minimal."); #define AUDIOOP_FINDFACTOR_METHODDEF \ @@ -227,7 +227,7 @@ } PyDoc_STRVAR(audioop_findmax__doc__, -"findmax(module, fragment, length)\n" +"sig=($module, fragment, length)\n" "Search fragment for a slice of specified number of samples with maximum energy."); #define AUDIOOP_FINDMAX_METHODDEF \ @@ -258,7 +258,7 @@ } PyDoc_STRVAR(audioop_avgpp__doc__, -"avgpp(module, fragment, width)\n" +"sig=($module, fragment, width)\n" "Return the average peak-peak value over all samples in the fragment."); #define AUDIOOP_AVGPP_METHODDEF \ @@ -289,7 +289,7 @@ } PyDoc_STRVAR(audioop_maxpp__doc__, -"maxpp(module, fragment, width)\n" +"sig=($module, fragment, width)\n" "Return the maximum peak-peak value in the sound fragment."); #define AUDIOOP_MAXPP_METHODDEF \ @@ -320,7 +320,7 @@ } PyDoc_STRVAR(audioop_cross__doc__, -"cross(module, fragment, width)\n" +"sig=($module, fragment, width)\n" "Return the number of zero crossings in the fragment passed as an argument."); #define AUDIOOP_CROSS_METHODDEF \ @@ -351,7 +351,7 @@ } PyDoc_STRVAR(audioop_mul__doc__, -"mul(module, fragment, width, factor)\n" +"sig=($module, fragment, width, factor)\n" "Return a fragment that has all samples in the original fragment multiplied by the floating-point value factor."); #define AUDIOOP_MUL_METHODDEF \ @@ -383,7 +383,7 @@ } PyDoc_STRVAR(audioop_tomono__doc__, -"tomono(module, fragment, width, lfactor, rfactor)\n" +"sig=($module, fragment, width, lfactor, rfactor)\n" "Convert a stereo fragment to a mono fragment."); #define AUDIOOP_TOMONO_METHODDEF \ @@ -416,7 +416,7 @@ } PyDoc_STRVAR(audioop_tostereo__doc__, -"tostereo(module, fragment, width, lfactor, rfactor)\n" +"sig=($module, fragment, width, lfactor, rfactor)\n" "Generate a stereo fragment from a mono fragment."); #define AUDIOOP_TOSTEREO_METHODDEF \ @@ -449,7 +449,7 @@ } PyDoc_STRVAR(audioop_add__doc__, -"add(module, fragment1, fragment2, width)\n" +"sig=($module, fragment1, fragment2, width)\n" "Return a fragment which is the addition of the two samples passed as parameters."); #define AUDIOOP_ADD_METHODDEF \ @@ -484,7 +484,7 @@ } PyDoc_STRVAR(audioop_bias__doc__, -"bias(module, fragment, width, bias)\n" +"sig=($module, fragment, width, bias)\n" "Return a fragment that is the original fragment with a bias added to each sample."); #define AUDIOOP_BIAS_METHODDEF \ @@ -516,7 +516,7 @@ } PyDoc_STRVAR(audioop_reverse__doc__, -"reverse(module, fragment, width)\n" +"sig=($module, fragment, width)\n" "Reverse the samples in a fragment and returns the modified fragment."); #define AUDIOOP_REVERSE_METHODDEF \ @@ -547,7 +547,7 @@ } PyDoc_STRVAR(audioop_byteswap__doc__, -"byteswap(module, fragment, width)\n" +"sig=($module, fragment, width)\n" "Convert big-endian samples to little-endian and vice versa."); #define AUDIOOP_BYTESWAP_METHODDEF \ @@ -578,7 +578,7 @@ } PyDoc_STRVAR(audioop_lin2lin__doc__, -"lin2lin(module, fragment, width, newwidth)\n" +"sig=($module, fragment, width, newwidth)\n" "Convert samples between 1-, 2-, 3- and 4-byte formats."); #define AUDIOOP_LIN2LIN_METHODDEF \ @@ -610,7 +610,7 @@ } PyDoc_STRVAR(audioop_ratecv__doc__, -"ratecv(module, fragment, width, nchannels, inrate, outrate, state, weightA=1, weightB=0)\n" +"sig=($module, fragment, width, nchannels, inrate, outrate, state, weightA=1, weightB=0)\n" "Convert the frame rate of the input fragment."); #define AUDIOOP_RATECV_METHODDEF \ @@ -647,7 +647,7 @@ } PyDoc_STRVAR(audioop_lin2ulaw__doc__, -"lin2ulaw(module, fragment, width)\n" +"sig=($module, fragment, width)\n" "Convert samples in the audio fragment to u-LAW encoding."); #define AUDIOOP_LIN2ULAW_METHODDEF \ @@ -678,7 +678,7 @@ } PyDoc_STRVAR(audioop_ulaw2lin__doc__, -"ulaw2lin(module, fragment, width)\n" +"sig=($module, fragment, width)\n" "Convert sound fragments in u-LAW encoding to linearly encoded sound fragments."); #define AUDIOOP_ULAW2LIN_METHODDEF \ @@ -709,7 +709,7 @@ } PyDoc_STRVAR(audioop_lin2alaw__doc__, -"lin2alaw(module, fragment, width)\n" +"sig=($module, fragment, width)\n" "Convert samples in the audio fragment to a-LAW encoding."); #define AUDIOOP_LIN2ALAW_METHODDEF \ @@ -740,7 +740,7 @@ } PyDoc_STRVAR(audioop_alaw2lin__doc__, -"alaw2lin(module, fragment, width)\n" +"sig=($module, fragment, width)\n" "Convert sound fragments in a-LAW encoding to linearly encoded sound fragments."); #define AUDIOOP_ALAW2LIN_METHODDEF \ @@ -771,7 +771,7 @@ } PyDoc_STRVAR(audioop_lin2adpcm__doc__, -"lin2adpcm(module, fragment, width, state)\n" +"sig=($module, fragment, width, state)\n" "Convert samples to 4 bit Intel/DVI ADPCM encoding."); #define AUDIOOP_LIN2ADPCM_METHODDEF \ @@ -803,7 +803,7 @@ } PyDoc_STRVAR(audioop_adpcm2lin__doc__, -"adpcm2lin(module, fragment, width, state)\n" +"sig=($module, fragment, width, state)\n" "Decode an Intel/DVI ADPCM coded fragment to a linear fragment."); #define AUDIOOP_ADPCM2LIN_METHODDEF \ @@ -833,4 +833,4 @@ return return_value; } -/*[clinic end generated code: checksum=0d9fa2c5719e996b169f808350016cd622799562]*/ +/*[clinic end generated code: checksum=ee7e58cfd3d0d5a62ec6f282b0bc00ca3d7f382d]*/ diff -r 0ae768637a07 Modules/clinic/binascii.c.h --- a/Modules/clinic/binascii.c.h Sat Jan 25 22:19:47 2014 -0800 +++ b/Modules/clinic/binascii.c.h Sun Jan 26 04:31:05 2014 -0800 @@ -3,7 +3,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(binascii_a2b_uu__doc__, -"a2b_uu(module, data)\n" +"sig=($module, data)\n" "Decode a line of uuencoded data."); #define BINASCII_A2B_UU_METHODDEF \ @@ -29,7 +29,7 @@ } PyDoc_STRVAR(binascii_b2a_uu__doc__, -"b2a_uu(module, data)\n" +"sig=($module, data)\n" "Uuencode line of data."); #define BINASCII_B2A_UU_METHODDEF \ @@ -59,7 +59,7 @@ } PyDoc_STRVAR(binascii_a2b_base64__doc__, -"a2b_base64(module, data)\n" +"sig=($module, data)\n" "Decode a line of base64 data."); #define BINASCII_A2B_BASE64_METHODDEF \ @@ -85,7 +85,7 @@ } PyDoc_STRVAR(binascii_b2a_base64__doc__, -"b2a_base64(module, data)\n" +"sig=($module, data)\n" "Base64-code line of data."); #define BINASCII_B2A_BASE64_METHODDEF \ @@ -115,7 +115,7 @@ } PyDoc_STRVAR(binascii_a2b_hqx__doc__, -"a2b_hqx(module, data)\n" +"sig=($module, data)\n" "Decode .hqx coding."); #define BINASCII_A2B_HQX_METHODDEF \ @@ -141,7 +141,7 @@ } PyDoc_STRVAR(binascii_rlecode_hqx__doc__, -"rlecode_hqx(module, data)\n" +"sig=($module, data)\n" "Binhex RLE-code binary data."); #define BINASCII_RLECODE_HQX_METHODDEF \ @@ -171,7 +171,7 @@ } PyDoc_STRVAR(binascii_b2a_hqx__doc__, -"b2a_hqx(module, data)\n" +"sig=($module, data)\n" "Encode .hqx data."); #define BINASCII_B2A_HQX_METHODDEF \ @@ -201,7 +201,7 @@ } PyDoc_STRVAR(binascii_rledecode_hqx__doc__, -"rledecode_hqx(module, data)\n" +"sig=($module, data)\n" "Decode hexbin RLE-coded string."); #define BINASCII_RLEDECODE_HQX_METHODDEF \ @@ -231,7 +231,7 @@ } PyDoc_STRVAR(binascii_crc_hqx__doc__, -"crc_hqx(module, data, crc)\n" +"sig=($module, data, crc)\n" "Compute hqx CRC incrementally."); #define BINASCII_CRC_HQX_METHODDEF \ @@ -266,7 +266,7 @@ } PyDoc_STRVAR(binascii_crc32__doc__, -"crc32(module, data, crc=0)\n" +"sig=($module, data, crc=0)\n" "Compute CRC-32 incrementally."); #define BINASCII_CRC32_METHODDEF \ @@ -301,7 +301,7 @@ } PyDoc_STRVAR(binascii_b2a_hex__doc__, -"b2a_hex(module, data)\n" +"sig=($module, data)\n" "Hexadecimal representation of binary data.\n" "\n" "The return value is a bytes object. This function is also\n" @@ -334,7 +334,7 @@ } PyDoc_STRVAR(binascii_a2b_hex__doc__, -"a2b_hex(module, hexstr)\n" +"sig=($module, hexstr)\n" "Binary data of hexadecimal representation.\n" "\n" "hexstr must contain an even number of hex digits (upper or lower case).\n" @@ -363,7 +363,7 @@ } PyDoc_STRVAR(binascii_a2b_qp__doc__, -"a2b_qp(module, data, header=False)\n" +"sig=($module, data, header=False)\n" "Decode a string of qp-encoded data."); #define BINASCII_A2B_QP_METHODDEF \ @@ -391,7 +391,7 @@ } PyDoc_STRVAR(binascii_b2a_qp__doc__, -"b2a_qp(module, data, quotetabs=False, istext=True, header=False)\n" +"sig=($module, data, quotetabs=False, istext=True, header=False)\n" "Encode a string using quoted-printable encoding.\n" "\n" "On encoding, when istext is set, newlines are not encoded, and white\n" @@ -427,4 +427,4 @@ return return_value; } -/*[clinic end generated code: checksum=abe48ca8020fa3ec25e13bd9fa7414f6b3ee2946]*/ +/*[clinic end generated code: checksum=6c1b7c18c4cde61a31366c8e3015b71477e0049a]*/ diff -r 0ae768637a07 Modules/posixmodule.c --- a/Modules/posixmodule.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Modules/posixmodule.c Sun Jan 26 04:31:05 2014 -0800 @@ -2430,7 +2430,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(os_stat__doc__, -"stat(module, path, *, dir_fd=None, follow_symlinks=True)\n" +"sig=($module, path, *, dir_fd=None, follow_symlinks=True)\n" "Perform a stat system call on the given path.\n" "\n" " path\n" @@ -2481,7 +2481,7 @@ static PyObject * os_stat_impl(PyModuleDef *module, path_t *path, int dir_fd, int follow_symlinks) -/*[clinic end generated code: checksum=09cc91b4947f9e3b9335c8be998bb7c56f7f8b40]*/ +/*[clinic end generated code: checksum=33b6ee92cd1b98de91b1a826b22c58b4ee3a4958]*/ { return posix_do_stat("stat", path, dir_fd, follow_symlinks); } @@ -2562,7 +2562,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(os_access__doc__, -"access(module, path, mode, *, dir_fd=None, effective_ids=False, follow_symlinks=True)\n" +"sig=($module, path, mode, *, dir_fd=None, effective_ids=False, follow_symlinks=True)\n" "Use the real uid/gid to test for access to a path.\n" "\n" " path\n" @@ -2622,7 +2622,7 @@ static PyObject * os_access_impl(PyModuleDef *module, path_t *path, int mode, int dir_fd, int effective_ids, int follow_symlinks) -/*[clinic end generated code: checksum=6483a51e1fee83da4f8e41cbc8054a701cfed1c5]*/ +/*[clinic end generated code: checksum=33b3fafc61e778e119f7e7338e42a6942003b910]*/ { PyObject *return_value = NULL; @@ -2718,7 +2718,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(os_ttyname__doc__, -"ttyname(module, fd)\n" +"sig=($module, fd)\n" "Return the name of the terminal device connected to \'fd\'.\n" "\n" " fd\n" @@ -2752,7 +2752,7 @@ static char * os_ttyname_impl(PyModuleDef *module, int fd) -/*[clinic end generated code: checksum=11bbb8b7969155f54bb8a1ec35ac1ebdfd4b0fec]*/ +/*[clinic end generated code: checksum=c3083e665d4d11b93fb62bd1cef0e3ad1821b3b8]*/ { char *ret; diff -r 0ae768637a07 Modules/unicodedata.c --- a/Modules/unicodedata.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Modules/unicodedata.c Sun Jan 26 04:31:05 2014 -0800 @@ -129,7 +129,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(unicodedata_UCD_decimal__doc__, -"decimal(self, unichr, default=None)\n" +"sig=($self, unichr, default=None)\n" "Converts a Unicode character into its equivalent decimal value.\n" "\n" "Returns the decimal value assigned to the Unicode character unichr\n" @@ -161,7 +161,7 @@ static PyObject * unicodedata_UCD_decimal_impl(PreviousDBVersion *self, PyUnicodeObject *unichr, PyObject *default_value) -/*[clinic end generated code: checksum=e1371a1a016e19fdd3cd2c1af1d1832df095f50b]*/ +/*[clinic end generated code: checksum=a3ad5de9393acb2fb2b0f33677e45dc447ab8b5c]*/ { int have_old = 0; long rc; diff -r 0ae768637a07 Modules/zlibmodule.c --- a/Modules/zlibmodule.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Modules/zlibmodule.c Sun Jan 26 04:31:05 2014 -0800 @@ -764,7 +764,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(zlib_Decompress_decompress__doc__, -"decompress(self, data, max_length=0)\n" +"sig=($self, data, max_length=0)\n" "Return a string containing the decompressed version of the data.\n" "\n" " data\n" @@ -807,7 +807,7 @@ static PyObject * zlib_Decompress_decompress_impl(compobject *self, Py_buffer *data, unsigned int max_length) -/*[clinic end generated code: checksum=b7fd2e3b23430f57f5a84817189575bc46464901]*/ +/*[clinic end generated code: checksum=c0bc5c65bf2129beb27444362e9be9fbf821d3c5]*/ { int err; unsigned int old_length, length = DEFAULTALLOC; @@ -1032,7 +1032,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(zlib_Compress_copy__doc__, -"copy(self)\n" +"sig=($self)\n" "Return a copy of the compression object."); #define ZLIB_COMPRESS_COPY_METHODDEF \ @@ -1049,7 +1049,7 @@ static PyObject * zlib_Compress_copy_impl(compobject *self) -/*[clinic end generated code: checksum=7aa841ad51297eb83250f511a76872e88fdc737e]*/ +/*[clinic end generated code: checksum=ce67ee6152bcd111cf2637972ea783e6d324285a]*/ { compobject *retval = NULL; int err; diff -r 0ae768637a07 Objects/descrobject.c --- a/Objects/descrobject.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Objects/descrobject.c Sun Jan 26 04:31:05 2014 -0800 @@ -353,17 +353,13 @@ static PyObject * method_get_doc(PyMethodDescrObject *descr, void *closure) { - const char *name = descr->d_method->ml_name; - const char *doc = descr->d_method->ml_doc; - return _PyType_GetDocFromInternalDoc(name, doc); + return _PyType_GetDocFromInternalDoc(descr->d_method->ml_doc); } static PyObject * method_get_text_signature(PyMethodDescrObject *descr, void *closure) { - const char *name = descr->d_method->ml_name; - const char *doc = descr->d_method->ml_doc; - return _PyType_GetTextSignatureFromInternalDoc(name, doc); + return _PyType_GetTextSignatureFromInternalDoc(descr->d_method->ml_doc); } static PyObject * @@ -470,17 +466,13 @@ static PyObject * wrapperdescr_get_doc(PyWrapperDescrObject *descr, void *closure) { - const char *name = descr->d_base->name; - const char *doc = descr->d_base->doc; - return _PyType_GetDocFromInternalDoc(name, doc); + return _PyType_GetDocFromInternalDoc(descr->d_base->doc); } static PyObject * wrapperdescr_get_text_signature(PyWrapperDescrObject *descr, void *closure) { - const char *name = descr->d_base->name; - const char *doc = descr->d_base->doc; - return _PyType_GetTextSignatureFromInternalDoc(name, doc); + return _PyType_GetTextSignatureFromInternalDoc(descr->d_base->doc); } static PyGetSetDef wrapperdescr_getset[] = { @@ -1159,17 +1151,13 @@ static PyObject * wrapper_doc(wrapperobject *wp, void *closure) { - const char *name = wp->descr->d_base->name; - const char *doc = wp->descr->d_base->doc; - return _PyType_GetDocFromInternalDoc(name, doc); + return _PyType_GetDocFromInternalDoc(wp->descr->d_base->doc); } static PyObject * wrapper_text_signature(wrapperobject *wp, void *closure) { - const char *name = wp->descr->d_base->name; - const char *doc = wp->descr->d_base->doc; - return _PyType_GetTextSignatureFromInternalDoc(name, doc); + return _PyType_GetTextSignatureFromInternalDoc(wp->descr->d_base->doc); } static PyObject * diff -r 0ae768637a07 Objects/dictobject.c --- a/Objects/dictobject.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Objects/dictobject.c Sun Jan 26 04:31:05 2014 -0800 @@ -1702,7 +1702,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(dict_fromkeys__doc__, -"fromkeys(type, iterable, value=None)\n" +"sig=($type, iterable, value=None)\n" "Returns a new dict with keys from iterable and values equal to value."); #define DICT_FROMKEYS_METHODDEF \ @@ -1730,7 +1730,7 @@ static PyObject * dict_fromkeys_impl(PyTypeObject *type, PyObject *iterable, PyObject *value) -/*[clinic end generated code: checksum=008269e1774a379b356841548c04061fd78a9542]*/ +/*[clinic end generated code: checksum=aff6e583703dbebadcbcb31c62e1abfe60d28151]*/ { PyObject *it; /* iter(seq) */ PyObject *key; @@ -2209,7 +2209,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(dict___contains____doc__, -"__contains__(self, key)\n" +"sig=($self, key)\n" "True if D has a key k, else False."); #define DICT___CONTAINS___METHODDEF \ @@ -2217,7 +2217,7 @@ static PyObject * dict___contains__(PyDictObject *self, PyObject *key) -/*[clinic end generated code: checksum=744ca54369dda9815a596304087f1b37fafa5960]*/ +/*[clinic end generated code: checksum=c654684a6d880281991260f4fa9231694118cf8c]*/ { register PyDictObject *mp = self; Py_hash_t hash; diff -r 0ae768637a07 Objects/methodobject.c --- a/Objects/methodobject.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Objects/methodobject.c Sun Jan 26 04:31:05 2014 -0800 @@ -182,17 +182,13 @@ static PyObject * meth_get__text_signature__(PyCFunctionObject *m, void *closure) { - const char *name = m->m_ml->ml_name; - const char *doc = m->m_ml->ml_doc; - return _PyType_GetTextSignatureFromInternalDoc(name, doc); + return _PyType_GetTextSignatureFromInternalDoc(m->m_ml->ml_doc); } static PyObject * meth_get__doc__(PyCFunctionObject *m, void *closure) { - const char *name = m->m_ml->ml_name; - const char *doc = m->m_ml->ml_doc; - return _PyType_GetDocFromInternalDoc(name, doc); + return _PyType_GetDocFromInternalDoc(m->m_ml->ml_doc); } static PyObject * diff -r 0ae768637a07 Objects/typeobject.c --- a/Objects/typeobject.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Objects/typeobject.c Sun Jan 26 04:31:05 2014 -0800 @@ -60,18 +60,11 @@ * otherwise returns NULL. */ static const char * -find_signature(const char *name, const char *doc) -{ - size_t length; - if (!doc || !name) - return NULL; - length = strlen(name); - if (strncmp(doc, name, length)) - return NULL; - doc += length; - if (*doc != '(') - return NULL; - return doc; +find_signature(const char *doc) +{ + if (doc && !strncmp(doc, "sig=(", 5)) + return doc + 4; + return NULL; } /* @@ -94,9 +87,9 @@ } static const char * -_PyType_DocWithoutSignature(const char *name, const char *internal_doc) -{ - const char *signature = find_signature(name, internal_doc); +_PyType_DocWithoutSignature(const char *internal_doc) +{ + const char *signature = find_signature(internal_doc); if (signature) return skip_eols(skip_signature(signature)); @@ -104,9 +97,9 @@ } PyObject * -_PyType_GetDocFromInternalDoc(const char *name, const char *internal_doc) -{ - const char *doc = _PyType_DocWithoutSignature(name, internal_doc); +_PyType_GetDocFromInternalDoc(const char *internal_doc) +{ + const char *doc = _PyType_DocWithoutSignature(internal_doc); if (!doc) { Py_INCREF(Py_None); @@ -117,9 +110,9 @@ } PyObject * -_PyType_GetTextSignatureFromInternalDoc(const char *name, const char *internal_doc) -{ - const char *signature = find_signature(name, internal_doc); +_PyType_GetTextSignatureFromInternalDoc(const char *internal_doc) +{ + const char *signature = find_signature(internal_doc); const char *doc; if (!signature) { @@ -706,9 +699,7 @@ { PyObject *result; if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE) && type->tp_doc != NULL) { - const char *name = type->tp_name; - const char *doc = type->tp_doc; - return _PyType_GetDocFromInternalDoc(name, doc); + return _PyType_GetDocFromInternalDoc(type->tp_doc); } result = _PyDict_GetItemId(type->tp_dict, &PyId___doc__); if (result == NULL) { @@ -728,9 +719,7 @@ static PyObject * type_get_text_signature(PyTypeObject *type, void *context) { - const char *name = type->tp_name; - const char *doc = type->tp_doc; - return _PyType_GetTextSignatureFromInternalDoc(name, doc); + return _PyType_GetTextSignatureFromInternalDoc(type->tp_doc); } static int @@ -2608,7 +2597,7 @@ /* need to make a copy of the docstring slot, which usually points to a static string literal */ if (slot->slot == Py_tp_doc) { - const char *old_doc = _PyType_DocWithoutSignature(spec->name, slot->pfunc); + const char *old_doc = _PyType_DocWithoutSignature(slot->pfunc); size_t len = strlen(old_doc)+1; char *tp_doc = PyObject_MALLOC(len); if (tp_doc == NULL) { @@ -3000,7 +2989,7 @@ PyDoc_STRVAR(type_doc, /* this text signature cannot be accurate yet. will fix. --larry */ -"type(object_or_name, bases, dict)\n" +"sig=(object_or_name, bases, dict)\n" "type(object) -> the object's type\n" "type(name, bases, dict) -> a new type"); @@ -4196,7 +4185,7 @@ PyObject_GenericSetAttr, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - PyDoc_STR("object()\nThe most base type"), /* tp_doc */ + PyDoc_STR("sig=()\nThe most base type"), /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ object_richcompare, /* tp_richcompare */ @@ -4663,7 +4652,7 @@ */ if (_PyDict_GetItemId(type->tp_dict, &PyId___doc__) == NULL) { if (type->tp_doc != NULL) { - const char *old_doc = _PyType_DocWithoutSignature(type->tp_name, type->tp_doc); + const char *old_doc = _PyType_DocWithoutSignature(type->tp_doc); PyObject *doc = PyUnicode_FromString(old_doc); if (doc == NULL) goto error; @@ -6098,22 +6087,22 @@ ETSLOT(NAME, as_number.SLOT, FUNCTION, WRAPPER, DOC) #define UNSLOT(NAME, SLOT, FUNCTION, WRAPPER, DOC) \ ETSLOT(NAME, as_number.SLOT, FUNCTION, WRAPPER, \ - NAME "(self)\n" DOC) + "sig=($self)\n" DOC) #define IBSLOT(NAME, SLOT, FUNCTION, WRAPPER, DOC) \ ETSLOT(NAME, as_number.SLOT, FUNCTION, WRAPPER, \ - NAME "(self, value)\nReturns self" DOC "value.") + "sig=($self, value)\nReturns self" DOC "value.") #define BINSLOT(NAME, SLOT, FUNCTION, DOC) \ ETSLOT(NAME, as_number.SLOT, FUNCTION, wrap_binaryfunc_l, \ - NAME "(self, value)\nReturns self" DOC "value.") + "sig=($self, value)\nReturns self" DOC "value.") #define RBINSLOT(NAME, SLOT, FUNCTION, DOC) \ ETSLOT(NAME, as_number.SLOT, FUNCTION, wrap_binaryfunc_r, \ - NAME "(self, value)\nReturns value" DOC "self.") + "sig=($self, value)\nReturns value" DOC "self.") #define BINSLOTNOTINFIX(NAME, SLOT, FUNCTION, DOC) \ ETSLOT(NAME, as_number.SLOT, FUNCTION, wrap_binaryfunc_l, \ - NAME "(self, value)\n" DOC) + "sig=($self, value)\n" DOC) #define RBINSLOTNOTINFIX(NAME, SLOT, FUNCTION, DOC) \ ETSLOT(NAME, as_number.SLOT, FUNCTION, wrap_binaryfunc_r, \ - NAME "(self, value)\n" DOC) + "sig=($self, value)\n" DOC) static slotdef slotdefs[] = { TPSLOT("__getattribute__", tp_getattr, NULL, NULL, ""), @@ -6121,51 +6110,51 @@ TPSLOT("__setattr__", tp_setattr, NULL, NULL, ""), TPSLOT("__delattr__", tp_setattr, NULL, NULL, ""), TPSLOT("__repr__", tp_repr, slot_tp_repr, wrap_unaryfunc, - "__repr__(self)\nReturns repr(self)."), + "sig=($self)\nReturns repr(self)."), TPSLOT("__hash__", tp_hash, slot_tp_hash, wrap_hashfunc, - "__hash__(self)\nReturns hash(self)."), + "sig=($self)\nReturns hash(self)."), FLSLOT("__call__", tp_call, slot_tp_call, (wrapperfunc)wrap_call, - "__call__(self, *args, **kwargs)\nCalls self as a function.", + "sig=($self, *args, **kwargs)\nCalls self as a function.", PyWrapperFlag_KEYWORDS), TPSLOT("__str__", tp_str, slot_tp_str, wrap_unaryfunc, - "__str__(self)\nReturns str(self)."), + "sig=($self)\nReturns str(self)."), TPSLOT("__getattribute__", tp_getattro, slot_tp_getattr_hook, wrap_binaryfunc, - "__getattribute__(self, name)\nReturns getattr(self, name)."), + "sig=($self, name)\nReturns getattr(self, name)."), TPSLOT("__getattr__", tp_getattro, slot_tp_getattr_hook, NULL, ""), TPSLOT("__setattr__", tp_setattro, slot_tp_setattro, wrap_setattr, - "__setattr__(self, name, value)\nImplements setattr(self, name, value)."), + "sig=($self, name, value)\nImplements setattr(self, name, value)."), TPSLOT("__delattr__", tp_setattro, slot_tp_setattro, wrap_delattr, - "__delattr__(self, name)\nImplements delattr(self, name)."), + "sig=($self, name)\nImplements delattr(self, name)."), TPSLOT("__lt__", tp_richcompare, slot_tp_richcompare, richcmp_lt, - "__lt__(self, value)\nReturns selfvalue."), + "sig=($self, value)\nReturns self>value."), TPSLOT("__ge__", tp_richcompare, slot_tp_richcompare, richcmp_ge, - "__ge__(self, value)\nReturns self>=value."), + "sig=($self, value)\nReturns self>=value."), TPSLOT("__iter__", tp_iter, slot_tp_iter, wrap_unaryfunc, - "__iter__(self)\nImplements iter(self)."), + "sig=($self)\nImplements iter(self)."), TPSLOT("__next__", tp_iternext, slot_tp_iternext, wrap_next, - "__next__(self)\nImplements next(self)."), + "sig=($self)\nImplements next(self)."), TPSLOT("__get__", tp_descr_get, slot_tp_descr_get, wrap_descr_get, - "__get__(self, instance, owner)\nCalled to get an attribute of instance, which is of type owner."), + "sig=($self, instance, owner)\nCalled to get an attribute of instance, which is of type owner."), TPSLOT("__set__", tp_descr_set, slot_tp_descr_set, wrap_descr_set, - "__set__(self, instance, value)\nSets an attribute of instance to value."), + "sig=($self, instance, value)\nSets an attribute of instance to value."), TPSLOT("__delete__", tp_descr_set, slot_tp_descr_set, wrap_descr_delete, - "__delete__(instance)\nDeletes an attribute of instance."), + "sig=(instance)\nDeletes an attribute of instance."), FLSLOT("__init__", tp_init, slot_tp_init, (wrapperfunc)wrap_init, - "__init__(self, *args, **kwargs)\n" + "sig=($self, *args, **kwargs)\n" "Initializes self. See help(type(self)) for accurate signature.", PyWrapperFlag_KEYWORDS), TPSLOT("__new__", tp_new, slot_tp_new, NULL, - "__new__(cls, *args, **kwargs)\n" + "sig=(cls, *args, **kwargs)\n" "Creates new object. See help(cls) for accurate signature."), TPSLOT("__del__", tp_finalize, slot_tp_finalize, (wrapperfunc)wrap_del, ""), @@ -6186,13 +6175,13 @@ RBINSLOT("__rmod__", nb_remainder, slot_nb_remainder, "%"), BINSLOTNOTINFIX("__divmod__", nb_divmod, slot_nb_divmod, - "__divmod__(self, value)\nReturns divmod(self, value)."), + "sig=($self, value)\nReturns divmod(self, value)."), RBINSLOTNOTINFIX("__rdivmod__", nb_divmod, slot_nb_divmod, - "__rdivmod__(self, value)\nReturns divmod(value, self)."), + "sig=($self, value)\nReturns divmod(value, self)."), NBSLOT("__pow__", nb_power, slot_nb_power, wrap_ternaryfunc, - "__pow__(self, value, mod=None)\nReturns pow(self, value, mod)."), + "sig=($self, value, mod=None)\nReturns pow(self, value, mod)."), NBSLOT("__rpow__", nb_power, slot_nb_power, wrap_ternaryfunc_r, - "__rpow__(self, value, mod=None)\nReturns pow(value, self, mod)."), + "sig=($self, value, mod=None)\nReturns pow(value, self, mod)."), UNSLOT("__neg__", nb_negative, slot_nb_negative, wrap_unaryfunc, "-self"), UNSLOT("__pos__", nb_positive, slot_nb_positive, wrap_unaryfunc, "+self"), UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc, @@ -6243,48 +6232,48 @@ IBSLOT("__itruediv__", nb_inplace_true_divide, slot_nb_inplace_true_divide, wrap_binaryfunc, "/"), NBSLOT("__index__", nb_index, slot_nb_index, wrap_unaryfunc, - "__index__(self)\n" + "sig=($self)\n" "Returns self converted to an integer, if self is suitable" "for use as an index into a list."), MPSLOT("__len__", mp_length, slot_mp_length, wrap_lenfunc, - "__len__(self)\nReturns len(self)."), + "sig=($self)\nReturns len(self)."), MPSLOT("__getitem__", mp_subscript, slot_mp_subscript, wrap_binaryfunc, - "__getitem__(self, key)\nReturns self[key]."), + "sig=($self, key)\nReturns self[key]."), MPSLOT("__setitem__", mp_ass_subscript, slot_mp_ass_subscript, wrap_objobjargproc, - "__setitem__(self, key, value)\nSets self[key] to value."), + "sig=($self, key, value)\nSets self[key] to value."), MPSLOT("__delitem__", mp_ass_subscript, slot_mp_ass_subscript, wrap_delitem, - "__delitem__(key)\nDeletes self[key]."), + "sig=(key)\nDeletes self[key]."), SQSLOT("__len__", sq_length, slot_sq_length, wrap_lenfunc, - "__len__(self)\nReturns len(self)."), + "sig=($self)\nReturns len(self)."), /* Heap types defining __add__/__mul__ have sq_concat/sq_repeat == NULL. The logic in abstract.c always falls back to nb_add/nb_multiply in this case. Defining both the nb_* and the sq_* slots to call the user-defined methods has unexpected side-effects, as shown by test_descr.notimplemented() */ SQSLOT("__add__", sq_concat, NULL, wrap_binaryfunc, - "__add__(self, value)\nReturns self+value."), + "sig=($self, value)\nReturns self+value."), SQSLOT("__mul__", sq_repeat, NULL, wrap_indexargfunc, - "__mul__(self, value)\nReturns self*value.n"), + "sig=($self, value)\nReturns self*value.n"), SQSLOT("__rmul__", sq_repeat, NULL, wrap_indexargfunc, - "__rmul__(self, value)\nReturns self*value."), + "sig=($self, value)\nReturns self*value."), SQSLOT("__getitem__", sq_item, slot_sq_item, wrap_sq_item, - "__getitem__(self, key)\nReturns self[key]."), + "sig=($self, key)\nReturns self[key]."), SQSLOT("__setitem__", sq_ass_item, slot_sq_ass_item, wrap_sq_setitem, - "__setitem__(self, key, value)\nSets self[key] to value."), + "sig=($self, key, value)\nSets self[key] to value."), SQSLOT("__delitem__", sq_ass_item, slot_sq_ass_item, wrap_sq_delitem, - "__delitem__(self, key)\nDeletes self[key]."), + "sig=($self, key)\nDeletes self[key]."), SQSLOT("__contains__", sq_contains, slot_sq_contains, wrap_objobjproc, - "__contains__(self, key)\nReturns key in self."), + "sig=($self, key)\nReturns key in self."), SQSLOT("__iadd__", sq_inplace_concat, NULL, wrap_binaryfunc, - "__iadd__(self, value)\nImplements self+=value."), + "sig=($self, value)\nImplements self+=value."), SQSLOT("__imul__", sq_inplace_repeat, NULL, wrap_indexargfunc, - "__imul__(self, value)\nImplements self*=value."), + "sig=($self, value)\nImplements self*=value."), {NULL} }; diff -r 0ae768637a07 Objects/unicodeobject.c --- a/Objects/unicodeobject.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Objects/unicodeobject.c Sun Jan 26 04:31:05 2014 -0800 @@ -12885,7 +12885,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(unicode_maketrans__doc__, -"maketrans(x, y=None, z=None)\n" +"sig=(x, y=None, z=None)\n" "Return a translation table usable for str.translate().\n" "\n" "If there is only one argument, it must be a dictionary mapping Unicode\n" @@ -12922,7 +12922,7 @@ static PyObject * unicode_maketrans_impl(PyObject *x, PyObject *y, PyObject *z) -/*[clinic end generated code: checksum=90a3de8c494b304687e1e0d7e5fa8ba78eac6533]*/ +/*[clinic end generated code: checksum=ca001ac83ed322690533ddd39831dd25267cb30d]*/ { PyObject *new = NULL, *key, *value; Py_ssize_t i = 0; diff -r 0ae768637a07 Python/import.c --- a/Python/import.c Sat Jan 25 22:19:47 2014 -0800 +++ b/Python/import.c Sun Jan 26 04:31:05 2014 -0800 @@ -232,7 +232,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_imp_lock_held__doc__, -"lock_held(module)\n" +"sig=($module)\n" "Return True if the import lock is currently held, else False.\n" "\n" "On platforms without threads, return False."); @@ -251,7 +251,7 @@ static PyObject * _imp_lock_held_impl(PyModuleDef *module) -/*[clinic end generated code: checksum=17172a9917d389dd1564e2108fec34d23aecb6c2]*/ +/*[clinic end generated code: checksum=5ce46d12a8e4c469d86cb6fc63a34a13c08e77b3]*/ { #ifdef WITH_THREAD return PyBool_FromLong(import_lock_thread != -1); @@ -270,7 +270,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_imp_acquire_lock__doc__, -"acquire_lock(module)\n" +"sig=($module)\n" "Acquires the interpreter\'s import lock for the current thread.\n" "\n" "This lock should be used by import hooks to ensure thread-safety when importing\n" @@ -290,7 +290,7 @@ static PyObject * _imp_acquire_lock_impl(PyModuleDef *module) -/*[clinic end generated code: checksum=20db30e18f6b8758386fe06907edb3f8e43080d7]*/ +/*[clinic end generated code: checksum=b0dd6a132ad25961a8d59b9c7d47c784f8f9a77d]*/ { #ifdef WITH_THREAD _PyImport_AcquireLock(); @@ -308,7 +308,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_imp_release_lock__doc__, -"release_lock(module)\n" +"sig=($module)\n" "Release the interpreter\'s import lock.\n" "\n" "On platforms without threads, this function does nothing."); @@ -327,7 +327,7 @@ static PyObject * _imp_release_lock_impl(PyModuleDef *module) -/*[clinic end generated code: checksum=17749fd7752d2c392447a1f83c5d371f54d7ebd3]*/ +/*[clinic end generated code: checksum=b1e6e9d723cf5f8958af288a93930b4c6eca80e3]*/ { #ifdef WITH_THREAD if (_PyImport_ReleaseLock() < 0) { @@ -927,7 +927,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_imp__fix_co_filename__doc__, -"_fix_co_filename(module, code, path)\n" +"sig=($module, code, path)\n" "Changes code.co_filename to specify the passed-in file path.\n" "\n" " code\n" @@ -960,7 +960,7 @@ static PyObject * _imp__fix_co_filename_impl(PyModuleDef *module, PyCodeObject *code, PyObject *path) -/*[clinic end generated code: checksum=d32cf2b2e0480c714f909921cc9e55d763b39dd5]*/ +/*[clinic end generated code: checksum=3fe5b5a1b0d497df35e7154e66723bcda28f7deb]*/ { update_compiled_module(code, path); @@ -1823,7 +1823,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_imp_extension_suffixes__doc__, -"extension_suffixes(module)\n" +"sig=($module)\n" "Returns the list of file suffixes used to identify extension modules."); #define _IMP_EXTENSION_SUFFIXES_METHODDEF \ @@ -1840,7 +1840,7 @@ static PyObject * _imp_extension_suffixes_impl(PyModuleDef *module) -/*[clinic end generated code: checksum=625c8f11a5bbd4b85373f0a54f7f3ef19c55beb4]*/ +/*[clinic end generated code: checksum=c1bcfbddabefa00af5b539ef68a5bd4ace80df24]*/ { PyObject *list; const char *suffix; @@ -1878,7 +1878,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_imp_init_builtin__doc__, -"init_builtin(module, name)\n" +"sig=($module, name)\n" "Initializes a built-in module."); #define _IMP_INIT_BUILTIN_METHODDEF \ @@ -1905,7 +1905,7 @@ static PyObject * _imp_init_builtin_impl(PyModuleDef *module, PyObject *name) -/*[clinic end generated code: checksum=a4e4805a523757cd3ddfeec6e5b16740678fed6a]*/ +/*[clinic end generated code: checksum=02437efd4668f53e40fd33503696ade7e83d6e07]*/ { int ret; PyObject *m; @@ -1932,7 +1932,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_imp_init_frozen__doc__, -"init_frozen(module, name)\n" +"sig=($module, name)\n" "Initializes a frozen module."); #define _IMP_INIT_FROZEN_METHODDEF \ @@ -1959,7 +1959,7 @@ static PyObject * _imp_init_frozen_impl(PyModuleDef *module, PyObject *name) -/*[clinic end generated code: checksum=2a58c119dd3e121cf5a9924f936cfd7b40253c12]*/ +/*[clinic end generated code: checksum=20cea421af513afee6980c22fcdfc0b48822f551]*/ { int ret; PyObject *m; @@ -1986,7 +1986,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_imp_get_frozen_object__doc__, -"get_frozen_object(module, name)\n" +"sig=($module, name)\n" "Create a code object for a frozen module."); #define _IMP_GET_FROZEN_OBJECT_METHODDEF \ @@ -2013,7 +2013,7 @@ static PyObject * _imp_get_frozen_object_impl(PyModuleDef *module, PyObject *name) -/*[clinic end generated code: checksum=94c9108b58dda80d187fef21275a009bd0f91e96]*/ +/*[clinic end generated code: checksum=f00d01ae30ec842f72641bdf88ce3d827c0fc1be]*/ { return get_frozen_object(name); } @@ -2028,7 +2028,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_imp_is_frozen_package__doc__, -"is_frozen_package(module, name)\n" +"sig=($module, name)\n" "Returns True if the module name is of a frozen package."); #define _IMP_IS_FROZEN_PACKAGE_METHODDEF \ @@ -2055,7 +2055,7 @@ static PyObject * _imp_is_frozen_package_impl(PyModuleDef *module, PyObject *name) -/*[clinic end generated code: checksum=17a342b94dbe859cdfc361bc8a6bc1b3cb163364]*/ +/*[clinic end generated code: checksum=35c78f2448c6fcff277cd11260b44c7e29bd90ba]*/ { return is_frozen_package(name); } @@ -2070,7 +2070,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_imp_is_builtin__doc__, -"is_builtin(module, name)\n" +"sig=($module, name)\n" "Returns True if the module name corresponds to a built-in module."); #define _IMP_IS_BUILTIN_METHODDEF \ @@ -2097,7 +2097,7 @@ static PyObject * _imp_is_builtin_impl(PyModuleDef *module, PyObject *name) -/*[clinic end generated code: checksum=51c6139dcfd9bee1f40980ea68b7797f8489d69a]*/ +/*[clinic end generated code: checksum=641689f833347f6617adbfc0162c201bafce6da9]*/ { return PyLong_FromLong(is_builtin(name)); } @@ -2112,7 +2112,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_imp_is_frozen__doc__, -"is_frozen(module, name)\n" +"sig=($module, name)\n" "Returns True if the module name corresponds to a frozen module."); #define _IMP_IS_FROZEN_METHODDEF \ @@ -2139,7 +2139,7 @@ static PyObject * _imp_is_frozen_impl(PyModuleDef *module, PyObject *name) -/*[clinic end generated code: checksum=4b079fb45a495835056ea5604735d552d222be5c]*/ +/*[clinic end generated code: checksum=0f80c7a3f283a686ecc8da553bf95e9d3ff53208]*/ { const struct _frozen *p; @@ -2161,7 +2161,7 @@ [clinic start generated code]*/ PyDoc_STRVAR(_imp_load_dynamic__doc__, -"load_dynamic(module, name, path, file=None)\n" +"sig=($module, name, path, file=None)\n" "Loads an extension module."); #define _IMP_LOAD_DYNAMIC_METHODDEF \ @@ -2190,7 +2190,7 @@ static PyObject * _imp_load_dynamic_impl(PyModuleDef *module, PyObject *name, PyObject *path, PyObject *file) -/*[clinic end generated code: checksum=63e051fd0d0350c785bf185be41b0892f9920622]*/ +/*[clinic end generated code: checksum=8f33f48dc6252948d21cc66fad6e7751b1e52e89]*/ { PyObject *mod; FILE *fp; diff -r 0ae768637a07 Tools/clinic/clinic.py --- a/Tools/clinic/clinic.py Sat Jan 25 22:19:47 2014 -0800 +++ b/Tools/clinic/clinic.py Sun Jan 26 04:31:05 2014 -0800 @@ -1826,7 +1826,8 @@ module, cls=None, c_basename=None, full_name=None, return_converter, return_annotation=_empty, - docstring=None, kind=CALLABLE, coexist=False): + docstring=None, kind=CALLABLE, coexist=False, + suppress_signature=False): self.parameters = parameters or collections.OrderedDict() self.return_annotation = return_annotation self.name = name @@ -1840,6 +1841,7 @@ self.kind = kind self.coexist = coexist self.self_converter = None + self.suppress_signature = suppress_signature @property def methoddef_flags(self): @@ -3520,6 +3522,7 @@ else: fail("Function " + self.function.name + " has an unsupported group configuration. (Unexpected state " + str(self.parameter_state) + ".b)") self.group += 1 + self.function.suppress_signature = True elif symbol == ']': if not self.group: fail("Function " + self.function.name + " has a ] without a matching [.") @@ -3615,11 +3618,14 @@ ## docstring first line ## - if new_or_init: - assert f.cls - add(f.cls.name) + if not f.suppress_signature: + add('sig=') else: - add(f.name) + if new_or_init: + assert f.cls + add(f.cls.name) + else: + add(f.name) add('(') # populate "right_bracket_count" field for every parameter @@ -3673,7 +3679,17 @@ add_comma = True name = p.converter.signature_name or p.name - a = [name] + + a = [] + if isinstance(p.converter, self_converter) and not f.suppress_signature: + # annotate first parameter as being a "self". + # + # if inspect.Signature gets this function, and it's already bound, + # the self parameter will be stripped off. + # + # if it's not bound, it should be marked as positional-only. + a.append('$') + a.append(name) if p.converter.is_optional(): a.append('=') value = p.converter.py_default