Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sandal-tan committed Jun 15, 2021
1 parent abf29b4 commit 0b2f6e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions envclasses/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ def bool_caster(value: Any) -> bool:
return bool(value)


def make_cast_function(_type: Callable) -> Callable:
def make_cast_function(type_: Callable) -> Callable:
"""Make a cast function for a given type.
This is to ensure that None is propagated correctly and not converted to another type.
Args:
_type: The type to cast the value to
type_: The type to cast the value to
Returns:
A function to cast to a type, preserving None
Expand All @@ -81,7 +81,7 @@ def _wrapper(value: Any) -> Any:
"""
if value is None:
return value
return _type(value)
return type_(value)

return _wrapper

Expand Down

0 comments on commit 0b2f6e5

Please sign in to comment.