Skip to content

Conversation

ShaharNaveh
Copy link
Contributor

@ShaharNaveh ShaharNaveh commented Dec 23, 2019

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

As @simonjayhawkins says here (comment), having Union with both int and float is redundant.

@ShaharNaveh ShaharNaveh changed the title CLN/TYP: Removed redundant 'int' CLN/TYP: Removed redundant 'int' from pandas/_typing.py Dec 23, 2019
FilePathOrBuffer = Union[str, Path, IO[AnyStr]]

FrameOrSeries = TypeVar("FrameOrSeries", bound="NDFrame")
Scalar = Union[str, int, float, bool]
Copy link
Contributor

Choose a reason for hiding this comment

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

how is this redundant? try an int is a float, but so it a bool technically, we want to be very explicit on these types.

@jreback jreback added the Typing type annotations, mypy/pyright type checking label Dec 23, 2019
@WillAyd
Copy link
Member

WillAyd commented Dec 23, 2019

Whether or not this changes anything for the type checker I think should keep both for the sake of explicitness

@jreback
Copy link
Contributor

jreback commented Dec 23, 2019

closing as per comments

@jreback jreback closed this Dec 23, 2019
@ShaharNaveh ShaharNaveh deleted the CLN-remove-useless-type branch December 24, 2019 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Typing type annotations, mypy/pyright type checking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants