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

✨ 为 MessageFactory 和 MessageSegmentFactory 添加类型提示 #127

Closed
wants to merge 8 commits into from

Conversation

AzideCupric
Copy link
Contributor

No description provided.

Copy link

netlify bot commented Dec 12, 2023

Deploy Preview for send-anything-anywhere ready!

Name Link
🔨 Latest commit 9204b9d
🔍 Latest deploy log https://app.netlify.com/sites/send-anything-anywhere/deploys/658be5987358fc0008e20ae3
😎 Deploy Preview https://deploy-preview-127--send-anything-anywhere.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (6985677) 95.86% compared to head (9204b9d) 96.04%.
Report is 1 commits behind head on main.

Files Patch % Lines
nonebot_plugin_saa/abstract_factories.py 98.16% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
+ Coverage   95.86%   96.04%   +0.18%     
==========================================
  Files          25       25              
  Lines        1814     1897      +83     
==========================================
+ Hits         1739     1822      +83     
  Misses         75       75              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AzideCupric AzideCupric force-pushed the typing/messagefactory branch from 17db995 to 59c5979 Compare December 12, 2023 14:00
TMSF = TypeVar("TMSF", bound="MessageSegmentFactory")
TMSFO = TypeVar("TMSFO", bound="MessageSegmentFactory")
Copy link
Collaborator

Choose a reason for hiding this comment

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

作用?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

表明是两个可能不同的子类

Copy link
Collaborator

Choose a reason for hiding this comment

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

有两个都用到的地方吗

if isinstance(obj, MessageSegmentFactory):
super().append(obj)
elif isinstance(obj, str):
def append(self, obj: Union[str, TMSFO]):
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里可能会break

return self

def extend(self: TMF, obj: Union[TMF, Iterable[TMSF]]) -> TMF:
def extend(self: TMF, obj: Union[TMF, Iterable[Union[str, TMSFO]]]):
Copy link
Collaborator

Choose a reason for hiding this comment

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

同样

@AzideCupric AzideCupric force-pushed the typing/messagefactory branch from 9204b9d to 2037e7f Compare December 27, 2023 08:46
@AzideCupric AzideCupric added invalid This doesn't seem right deprecated Deprecated this pr by another and removed invalid This doesn't seem right labels Dec 27, 2023
@AzideCupric AzideCupric deleted the typing/messagefactory branch March 25, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated Deprecated this pr by another
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants