Skip to content
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

Annotate abstract.py #1522

Merged
merged 9 commits into from
May 15, 2022
Merged

Annotate abstract.py #1522

merged 9 commits into from
May 15, 2022

Conversation

Kludex
Copy link
Contributor

@Kludex Kludex commented Apr 11, 2022

Related to #1511

@Kludex
Copy link
Contributor Author

Kludex commented Apr 11, 2022

Why is there a bot that commits on my branch...

@Kludex Kludex force-pushed the annotate/abstract branch from d500c39 to c588c27 Compare April 11, 2022 19:24
Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


def unpickle_dict(cls, kwargs):
def unpickle_dict(
cls: Type[_ObjectType], kwargs: Dict[str, Any]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Any is alright.

@@ -23,9 +37,9 @@ class Object:
Supports automatic kwargs->attributes handling, and cloning.
"""

attrs = ()
attrs: Tuple[Tuple[str, Any], ...] = ()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing here is that each attr can really be Any, and str is the name of the attr. It looks fine as well.

def as_dict(self, recurse=False):
def f(obj, type):
def as_dict(self, recurse: bool = False) -> Dict[str, Any]:
def f(obj: Any, type: Callable[[Any], Any]) -> Any:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the only place that we can try to improve... I'm not sure what can be a good replacement tho...

@Kludex Kludex requested a review from auvipy May 4, 2022 18:29
@Kludex
Copy link
Contributor Author

Kludex commented May 4, 2022

rebased 👍

@auvipy auvipy merged commit 0a2f54e into celery:master May 15, 2022
@auvipy auvipy added this to the 5.3 milestone May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants