-
Notifications
You must be signed in to change notification settings - Fork 104
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
correction initialize args and comprehention constructions #527
correction initialize args and comprehention constructions #527
Conversation
ArtemIsmagilov
commented
Jul 15, 2024
- create generator comprehention, lazy object
- remove dangerous pass mut args in func initialize, removed overwriting args
- create list comprehention, high perfomance
2. remove dangerous pass mut args in func initialize, removed overwriting args 3. create list comprehention, high perfomance
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.
The rest of the PR looks fine. The list comprehension here is clear.
mmpy_bot/driver.py
Outdated
@@ -160,14 +160,15 @@ def direct_message( | |||
message: str, | |||
file_paths: Optional[Sequence[str]] = None, | |||
root_id: str = "", | |||
props: Dict = {}, | |||
props: Dict = None, |
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.
Same as above, won't type-check.
mmpy_bot/driver.py
Outdated
@@ -116,7 +116,7 @@ def reply_to( | |||
message: Message, | |||
response: str, | |||
file_paths: Optional[Sequence[str]] = None, | |||
props: Dict = {}, | |||
props: Dict = None, |
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.
Same as above, won't type-check.
mmpy_bot/driver.py
Outdated
@@ -43,7 +43,7 @@ def create_post( | |||
message: str, | |||
file_paths: Optional[Sequence[str]] = None, | |||
root_id: str = "", | |||
props: Dict = {}, | |||
props: Dict = None, |
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.
This won't type check.
Code Climate has analyzed commit 78b613e and detected 0 issues on this pull request. View more on Code Climate. |
@@ -34,7 +34,7 @@ def expect_reply(driver: Driver, post: Dict, wait=RESPONSE_TIMEOUT, retries=1): | |||
reply = thread_info["posts"][reply_id] | |||
break | |||
|
|||
if not reply: | |||
if reply is None: |
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.
boolean 0 will be false
1. create generator comprehension, lazy object 2. remove dangerous pass mut args in func initialize, removed overwriting args 3. create list comprehension, high performance