From 1fbd166c0206b1cbe6cb191bc550c11c3801d1f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl> Date: Mon, 4 Mar 2024 10:55:17 +0100 Subject: [PATCH] Fixes for overload --- satella/__init__.py | 2 +- satella/coding/overloading.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/satella/__init__.py b/satella/__init__.py index fd3c76e6..265ec16a 100644 --- a/satella/__init__.py +++ b/satella/__init__.py @@ -1 +1 @@ -__version__ = '2.24.1a6' +__version__ = '2.24.1a7' diff --git a/satella/coding/overloading.py b/satella/coding/overloading.py index 134aa63a..fb8fdbed 100644 --- a/satella/coding/overloading.py +++ b/satella/coding/overloading.py @@ -35,14 +35,15 @@ class TypeSignature(inspect.Signature): You can compare signatures: - >>> def a(a: object): + >>> def a(y: object): >>> pass - >>> def b(a: int): + >>> def b(y: int): >>> pass >>> TypeSignature.from_fun(a) < TypeSignature(b) """ __slots__ = () + # pylint: disable=protected-access def __init__(self, t_sign: inspect.Signature): """ :param t_sign: a inspect.Signature @@ -150,7 +151,7 @@ class overload: for sign, fun in self.type_signatures_to_functions.items(): if sign.matches(*args, **kwargs): matching.append((sign, fun)) - matching.sort() + matching.sort() # This sorting should result in most precise class at the end of the list if not matching: raise TypeError('No matching entries!') else: -- GitLab