Skip to content

Complete stubs for commonmark #13724

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

Merged
merged 1 commit into from
Mar 27, 2025
Merged

Conversation

donBarbos
Copy link
Contributor

No description provided.

Copy link
Contributor

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

@srittau srittau merged commit 3e49c2d into python:main Mar 27, 2025
43 checks passed
def parseLinkTitle(self) -> str | None: ...
def parseLinkDestination(self) -> str | None: ...
def parseLinkLabel(self) -> int: ...
def parseOpenBracket(self, block: Node) -> Literal[True]: ...
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
Collaborator

Choose a reason for hiding this comment

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

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
Contributor Author

Choose a reason for hiding this comment

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

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
Collaborator

Choose a reason for hiding this comment

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

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
Contributor Author

Choose a reason for hiding this comment

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

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
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