Skip to content

Commit ea3d879

Browse files
hukkinj1sloria
andauthored
Loosen ParserMethod typing (#188)
* Loosen ParserMethod typing * Run mypy against examples/ dir * Update changelog Co-authored-by: Steven Loria <sloria1@gmail.com>
1 parent 8338fb1 commit ea3d879

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ Features:
88
([#184](https://github.com/sloria/environs/pull/184)).
99
Thanks [tomgrin10](https://github.com/tomgrin10?) for the PR.
1010

11+
Bug fixes:
12+
13+
- Loosen `ParserMethod` typing ([#186 (comment)](https://github.com/sloria/environs/issues/186#issuecomment-723163520)).
14+
Thanks [hukkinj1](https://github.com/hukkinj1) for the PR.
15+
1116
Other changes:
1217

1318
- When using deferred validation (`eager=False`), parser methods return `None`

environs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
Subcast = typing.Union[typing.Type, typing.Callable[..., _T]]
3131
FieldType = typing.Type[ma.fields.Field]
3232
FieldOrFactory = typing.Union[FieldType, FieldFactory]
33-
ParserMethod = typing.Callable[..., typing.Optional[_T]]
33+
ParserMethod = typing.Callable
3434

3535

3636
_EXPANDED_VAR_PATTERN = re.compile(r"(?<!\\)\$\{([A-Za-z0-9_]+)(:-[^\}:]*)?\}")

0 commit comments

Comments
 (0)