Skip to content

Add stubs for tabulate - #2384

Merged
srittau merged 1 commit into
python:masterfrom
gaul:tabulate
Dec 17, 2018
Merged

srittau merged 1 commit into
python:masterfrom
gaul:tabulate

Conversation

@gaul

@gaul gaul commented Aug 15, 2018

Copy link
Copy Markdown
Contributor

No description provided.

@JelleZijlstra

Copy link
Copy Markdown
Member

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

@gaul

gaul commented Aug 21, 2018

Copy link
Copy Markdown
Contributor Author

@srittau srittau left a comment

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.

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

A few notes below.

Comment thread third_party/2and3/tabulate.pyi Outdated


def tabulate(
tabular_data: Sequence[Sequence[Any]],

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.

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

Choose a reason for hiding this comment

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

Done.

Comment thread third_party/2and3/tabulate.pyi Outdated

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

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.

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

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.

Done.

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


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.

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

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

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.

Done.

@srittau

srittau commented Dec 2, 2018

Copy link
Copy Markdown
Collaborator

@gaul

@gaul gaul left a comment

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.

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

Choose a reason for hiding this comment

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

Done.

Comment thread third_party/2and3/tabulate.pyi Outdated


def tabulate(
tabular_data: Sequence[Sequence[Any]],

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.

Done.

Comment thread third_party/2and3/tabulate.pyi Outdated

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

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.

Done.

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

srittau commented Dec 17, 2018

Copy link
Copy Markdown
Collaborator

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