FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Complete stubs for `commonmark` by donbarbos · Pull Request #13724 · python/typeshed · GitHub

Repository navigation

Complete stubs for commonmark - #13724

Merged
srittau merged 1 commit into
python:mainfrom
donbarbos:complete-commonmark
Mar 27, 2025
Merged

srittau merged 1 commit into
python:mainfrom
donbarbos:complete-commonmark

Conversation

Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

srittau merged commit 3e49c2d into python:main Mar 27, 2025
def parseBang(self, block: Node) -> Literal[True]: ...
def parseCloseBracket(self, block: Node) -> Literal[True]: ...
def addBracket(self, node, index, image) -> None: ...
def addBracket(self, node: Node, index: int, image: bool | None) -> None: ...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Not sure if None is completely appropriate here. It technically works, but looking at the source, it's always used as a boolean, no None check, and only ever passed True or False in this method's usage.

But I also see that when a parameter is unused, the source defaults it to None, even boolean.

And @srittau already accepted those in #13681

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That's why I left None because the internal logic doesn't prohibit it

maybe someone prefers not to pass this argument then it will work as False

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Well in this case if you don't pass an argument you'll get TypeError: addBracket() missing 1 required positional argument: 'image' 😉
But semantic details aside, reviewing this PR made me realize the library this stubs is archived and deprecated. And now that you completed it, I think it's good for a sendoff. #13725

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

indeed, this can be fixed together with dict in PR before deletion

mmingyu pushed a commit to mmingyu/typeshed that referenced this pull request May 16, 2025
donbarbos deleted the complete-commonmark branch February 25, 2026 04:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL