Skip to content

Add stubs for tabulate #2384

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
Dec 17, 2018
Merged

Add stubs for tabulate #2384

merged 1 commit into from
Dec 17, 2018

Conversation

gaul
Copy link
Contributor

@gaul gaul commented Aug 15, 2018

No description provided.

@JelleZijlstra
Copy link
Member

Can you get permission from the author of this library, as required by typeshed's guidelines?

@gaul
Copy link
Contributor Author

gaul commented Aug 21, 2018

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution. Since upstream did not respond yet, we will include the stub in typeshed.

A few notes below.



def tabulate(
tabular_data: Sequence[Sequence[Any]],
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be at least Iterable[Iterable[Any]]. It seems that tabulate supports a few more formats, so maybe Any would be better for the moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


def tabulate(
tabular_data: Sequence[Sequence[Any]],
headers: Sequence[str] = ...,
Copy link
Collaborator

Choose a reason for hiding this comment

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

headers can also be a str or a Dict[str, str].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

# Stub for tabulate: https://bitbucket.org/astanin/python-tabulate
from typing import Any, Sequence


Copy link
Collaborator

Choose a reason for hiding this comment

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

Since the stub is incomplete, please add the following at module level:

def __getattr__(name: str) -> Any: ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@srittau
Copy link
Collaborator

srittau commented Dec 2, 2018

@gaul

Copy link
Contributor Author

@gaul gaul left a comment

Choose a reason for hiding this comment

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

Sorry for my delayed response; I was traveling for a few weeks.

# Stub for tabulate: https://bitbucket.org/astanin/python-tabulate
from typing import Any, Sequence


Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.



def tabulate(
tabular_data: Sequence[Sequence[Any]],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


def tabulate(
tabular_data: Sequence[Sequence[Any]],
headers: Sequence[str] = ...,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@srittau srittau merged commit 6206c5a into python:master Dec 17, 2018
@srittau
Copy link
Collaborator

srittau commented Dec 17, 2018

Thank you. Just for future reference: We prefer people not to force push, since this makes it harder for us to review changes. We squash commits anyway when we merge changes.

@gaul gaul deleted the tabulate branch December 17, 2018 20:11
yedpodtrzitko pushed a commit to yedpodtrzitko/typeshed that referenced this pull request Jan 23, 2019
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