mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Update type of Formatter.convert_field (missing |None) (#11377)
From the source it expects that the second parameter (conversion), can
be None:
```python
def convert_field(self, value, conversion):
# do any conversion on the resulting object
if conversion is None:
return value
...
```
Since at least 17 years according to git blame, as None is refered as
early as 11529195cae2438a3ac003babcb1b11af67c4037
And still present in main branch:
ef3ceab09d/Lib/string.py
This commit is contained in:
@@ -80,4 +80,4 @@ class Formatter:
|
||||
def get_value(self, key: int | str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ...
|
||||
def check_unused_args(self, used_args: set[int | str], args: Sequence[Any], kwargs: Mapping[str, Any]) -> None: ...
|
||||
def format_field(self, value: Any, format_spec: str) -> Any: ...
|
||||
def convert_field(self, value: Any, conversion: str) -> Any: ...
|
||||
def convert_field(self, value: Any, conversion: str | None) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user