-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TYP: _config/config.py && core/{apply,construction}.py #30734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
2610ba2
c399d1d
bcf9d76
d1f3fe9
15d6135
0ad85df
27b8e24
8b54e82
3684b30
ce169f5
5d2c111
3db9cb0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -416,8 +416,8 @@ def register_option( | |||||
key: str, | ||||||
defval: object, | ||||||
doc: str = "", | ||||||
validator: Optional[Callable] = None, | ||||||
cb: Optional[Callable] = None, | ||||||
validator=None, | ||||||
cb: Optional[Callable[[str], None]] = None, | ||||||
) -> None: | ||||||
""" | ||||||
Register an option in the package-wide pandas config object | ||||||
|
@@ -734,7 +734,7 @@ def config_prefix(prefix): | |||||
global register_option, get_option, set_option, reset_option | ||||||
|
||||||
def wrap(func): | ||||||
def inner(key: str, *args, **kwds) -> Callable: | ||||||
def inner(key: str, *args, **kwds) -> Callable[[str, Any, Any], Any]: | ||||||
ShaharNaveh marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
pkey = f"{prefix}.{key}" | ||||||
return func(pkey, *args, **kwds) | ||||||
|
||||||
|
@@ -756,7 +756,7 @@ def inner(key: str, *args, **kwds) -> Callable: | |||||
# arg in register_option | ||||||
|
||||||
|
||||||
def is_type_factory(_type) -> Callable: | ||||||
def is_type_factory(_type) -> Callable[..., None]: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the returned function accepts exactly one argument
Suggested change
|
||||||
""" | ||||||
|
||||||
Parameters | ||||||
|
@@ -777,7 +777,7 @@ def inner(x) -> None: | |||||
return inner | ||||||
|
||||||
|
||||||
def is_instance_factory(_type) -> Callable: | ||||||
def is_instance_factory(_type) -> Callable[..., None]: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the returned function accepts exactly one argument
Suggested change
|
||||||
""" | ||||||
|
||||||
Parameters | ||||||
|
@@ -804,7 +804,7 @@ def inner(x) -> None: | |||||
return inner | ||||||
|
||||||
|
||||||
def is_one_of_factory(legal_values) -> Callable: | ||||||
def is_one_of_factory(legal_values) -> Callable[..., None]: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
callables = [c for c in legal_values if callable(c)] | ||||||
legal_values = [c for c in legal_values if not callable(c)] | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to validator, restricting the return type to None may not be desirable.