Created on 2018-03-06 07:33 by Antony.Lee, last changed 2018-03-06 18:49 by yselivanov. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 6004 | merged | yselivanov, 2018-03-06 16:56 | |
| PR 6006 | merged | miss-islington, 2018-03-06 17:59 | |
| PR 6007 | merged | miss-islington, 2018-03-06 18:00 | |
| Messages (6) | |||
|---|---|---|---|
| msg313309 - (view) | Author: Antony Lee (Antony.Lee) * | Date: 2018-03-06 07:33 | |
The following example crashes Python 3.6:
from functools import partialmethod
import inspect
class T:
g = partialmethod((lambda self, x: x), 1)
print(T().g()) # Correctly returns 1.
print(T.g(T())) # Correctly returns 1.
print(inspect.signature(T.g)) # Crashes.
with
File "/usr/lib/python3.6/inspect.py", line 3036, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
File "/usr/lib/python3.6/inspect.py", line 2786, in from_callable
follow_wrapper_chains=follow_wrapped)
File "/usr/lib/python3.6/inspect.py", line 2254, in _signature_from_callable
assert first_wrapped_param is not sig_params[0]
IndexError: tuple index out of range
|
|||
| msg313310 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2018-03-06 08:05 | |
This is not a crash, but an assertion failure. The assertion was added in issue30149. |
|||
| msg313340 - (view) | Author: Yury Selivanov (yselivanov) * | Date: 2018-03-06 16:56 | |
Yeah, that assertion needs to be tweaked a little bit. Created a PR. |
|||
| msg313345 - (view) | Author: Yury Selivanov (yselivanov) * | Date: 2018-03-06 17:59 | |
New changeset 8a387219bdfb6ee34928d6168ac42ca559f11c9a by Yury Selivanov in branch 'master': bpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004) https://github.com/python/cpython/commit/8a387219bdfb6ee34928d6168ac42ca559f11c9a |
|||
| msg313354 - (view) | Author: miss-islington (miss-islington) | Date: 2018-03-06 18:23 | |
New changeset 112f799666bac1bdbb320840d5fda3132255eb5e by Miss Islington (bot) in branch '3.7': bpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004) https://github.com/python/cpython/commit/112f799666bac1bdbb320840d5fda3132255eb5e |
|||
| msg313356 - (view) | Author: miss-islington (miss-islington) | Date: 2018-03-06 18:48 | |
New changeset 387a055261267f5fafd2c12eafef49759c94704f by Miss Islington (bot) in branch '3.6': bpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004) https://github.com/python/cpython/commit/387a055261267f5fafd2c12eafef49759c94704f |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2018-03-06 18:49:27 | yselivanov | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2018-03-06 18:48:10 | miss-islington | set | messages: + msg313356 |
| 2018-03-06 18:23:51 | miss-islington | set | nosy:
+ miss-islington messages: + msg313354 |
| 2018-03-06 18:00:54 | miss-islington | set | pull_requests: + pull_request5772 |
| 2018-03-06 17:59:56 | miss-islington | set | pull_requests: + pull_request5771 |
| 2018-03-06 17:59:48 | yselivanov | set | messages: + msg313345 |
| 2018-03-06 16:56:56 | yselivanov | set | messages: + msg313340 |
| 2018-03-06 16:56:26 | yselivanov | set | keywords:
+ patch stage: needs patch -> patch review pull_requests: + pull_request5769 |
| 2018-03-06 08:05:04 | serhiy.storchaka | set | versions:
+ Python 3.7, Python 3.8 type: behavior nosy:
+ yselivanov, serhiy.storchaka |
| 2018-03-06 07:33:47 | Antony.Lee | create | |