-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conversation
✅ Deploy Preview for send-anything-anywhere ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention:
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. |
17db995
to
59c5979
Compare
TMSF = TypeVar("TMSF", bound="MessageSegmentFactory") | ||
TMSFO = TypeVar("TMSFO", bound="MessageSegmentFactory") |
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.
作用?
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.
表明是两个可能不同的子类
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.
有两个都用到的地方吗
if isinstance(obj, MessageSegmentFactory): | ||
super().append(obj) | ||
elif isinstance(obj, str): | ||
def append(self, obj: Union[str, TMSFO]): |
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.
这里可能会break
return self | ||
|
||
def extend(self: TMF, obj: Union[TMF, Iterable[TMSF]]) -> TMF: | ||
def extend(self: TMF, obj: Union[TMF, Iterable[Union[str, TMSFO]]]): |
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.
同样
9204b9d
to
2037e7f
Compare
No description provided.