-
Notifications
You must be signed in to change notification settings - Fork 74
fixed some pylance errors and import errors #30
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 all commits
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 | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,7 +6,9 @@ | |||||||||||||||||||||||||||
| class PocketOptionError(Exception): | ||||||||||||||||||||||||||||
| """Base exception for all PocketOption API errors""" | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| def __init__(self, message: str, error_code: str = None): | ||||||||||||||||||||||||||||
| from typing import Optional | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| def __init__(self, message: str, error_code: Optional[str] = None): | ||||||||||||||||||||||||||||
|
Comment on lines
+9
to
+11
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. Move import to module level. The Apply this diff to fix the import placement: +from typing import Optional
+
+
class PocketOptionError(Exception):
"""Base exception for all PocketOption API errors"""
- from typing import Optional
-
- def __init__(self, message: str, error_code: Optional[str] = None):
+ def __init__(self, message: str, error_code: Optional[str] = None):📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| super().__init__(message) | ||||||||||||||||||||||||||||
| self.message = message | ||||||||||||||||||||||||||||
| self.error_code = error_code | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
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.
🛠️ Refactor suggestion
Move the import to module level.
The
Optionalimport should be placed at the top of the file with other imports, not inside the class definition. This is against Python conventions and could cause issues.And remove the import from inside the class:
📝 Committable suggestion
🤖 Prompt for AI Agents