From fb373f4c7abd42971fa16e3f1e718a17cbf9095d Mon Sep 17 00:00:00 2001 From: sobolevn Date: Wed, 22 Nov 2023 14:58:00 +0300 Subject: [PATCH] Document differences better --- README.md | 7 ++++++- tests/test_signature.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2ed1339..d2f52c5 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ Here's how `getfullargspec` is different from regular `signature` call: >>> inspect.getfullargspec(A().method) FullArgSpec(args=['self', 'arg'], varargs=None, varkw=None, defaults=None, kwonlyargs=[], kwonlydefaults=None, annotations={'return': None, 'arg': }) +>>> # signature() produces a different result: >>> inspect.signature(A().method) None> @@ -62,9 +63,13 @@ FullArgSpec(args=['self', 'arg'], varargs=None, varkw=None, defaults=None, kwonl >>> inspect.getfullargspec(func) FullArgSpec(args=[], varargs='args', varkw='kwargs', defaults=None, kwonlyargs=[], kwonlydefaults=None, annotations={'return': None}) +>>> # signature() produces a different result: +>>> inspect.signature(func) + None> + ``` -Here's how you can migrate: +Here's how you can migrate, these results will be in line with `getfullargspec`: ```python >>> import inspect313 diff --git a/tests/test_signature.py b/tests/test_signature.py index ff66945..3eabdcd 100644 --- a/tests/test_signature.py +++ b/tests/test_signature.py @@ -1,6 +1,6 @@ import functools import inspect -from typing import Any, TypeVar, Callable, cast +from typing import Any, Callable, TypeVar, cast import pytest