Skip to content

Contributed stubs for markdown package #4426

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 4 commits into from
Aug 10, 2020

Conversation

erictraut
Copy link
Contributor

No description provided.

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thanks! This is also missing init.pyi, which a) seems to cause mypy to not find these stubs, b) you'll want to import Markdown, markdown and markdownFromFile as per https://github.com/Python-Markdown/markdown/blob/370e17b3923d7d8f4709652bc24b695271a0210d/markdown/__init__.py#L38
Also CI says isort is unhappy

class Markdown:
def __init__(
self,
extensions: Optional[Sequence[Union[str, Extension]]] = ...,
Copy link
Collaborator

Choose a reason for hiding this comment

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

These should be marked as keyword-only


def markdown(
text: Text,
extensions: Optional[Sequence[Union[str, Extension]]] = ...,
Copy link
Collaborator

Choose a reason for hiding this comment

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

extensions and on should be keyword only

tab_length: Optional[int] = ...,
) -> Text: ...
def markdownFromFile(
input: Optional[Union[str, TextIO, BinaryIO]] = ...,
Copy link
Collaborator

Choose a reason for hiding this comment

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

all of these should also be keyword only

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants