| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2020,29 +2020,6 @@ def _signature_is_functionlike(obj): | |||
| 2020 | 2020 | (isinstance(annotations, (dict)) or annotations is None) ) | |
| 2021 | 2021 | ||
| 2022 | 2022 | ||
| 2023 | - def _signature_get_bound_param(spec): | ||
| 2024 | - """ Private helper to get first parameter name from a | ||
| 2025 | - __text_signature__ of a builtin method, which should | ||
| 2026 | - be in the following format: '($param1, ...)'. | ||
| 2027 | - Assumptions are that the first argument won't have | ||
| 2028 | - a default value or an annotation. | ||
| 2029 | - """ | ||
| 2030 | - | ||
| 2031 | - assert spec.startswith('($') | ||
| 2032 | - | ||
| 2033 | - pos = spec.find(',') | ||
| 2034 | - if pos == -1: | ||
| 2035 | - pos = spec.find(')') | ||
| 2036 | - | ||
| 2037 | - cpos = spec.find(':') | ||
| 2038 | - assert cpos == -1 or cpos > pos | ||
| 2039 | - | ||
| 2040 | - cpos = spec.find('=') | ||
| 2041 | - assert cpos == -1 or cpos > pos | ||
| 2042 | - | ||
| 2043 | - return spec[2:pos] | ||
| 2044 | - | ||
| 2045 | - | ||
| 2046 | 2023 | def _signature_strip_non_python_syntax(signature): | |
| 2047 | 2024 | """ | |
| 2048 | 2025 | Private helper function. Takes a signature in Argument Clinic's | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4014,13 +4014,6 @@ def foo(a): pass | |||
| 4014 | 4014 | self.assertIs(type(ba.arguments), dict) | |
| 4015 | 4015 | ||
| 4016 | 4016 | class TestSignaturePrivateHelpers(unittest.TestCase): | |
| 4017 | - def test_signature_get_bound_param(self): | ||
| 4018 | - getter = inspect._signature_get_bound_param | ||
| 4019 | - | ||
| 4020 | - self.assertEqual(getter('($self)'), 'self') | ||
| 4021 | - self.assertEqual(getter('($self, obj)'), 'self') | ||
| 4022 | - self.assertEqual(getter('($cls, /, obj)'), 'cls') | ||
| 4023 | - | ||
| 4024 | 4017 | def _strip_non_python_syntax(self, input, | |
| 4025 | 4018 | clean_signature, self_parameter, last_positional_only): | |
| 4026 | 4019 | computed_clean_signature, \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,2 @@ | |||
| 1 | + Remove unused ``_signature_get_bound_param`` function from :mod:`inspect` - | ||
| 2 | + by Anthony Sottile. | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments