Skip to content

Unnecessary attrs in NaTType? #17429

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

Closed
jbrockmendel opened this issue Sep 4, 2017 · 1 comment · Fixed by #17431
Closed

Unnecessary attrs in NaTType? #17429

jbrockmendel opened this issue Sep 4, 2017 · 1 comment · Fixed by #17431
Labels
Clean Internals Related to non-user accessible pandas implementation
Milestone

Comments

@jbrockmendel
Copy link
Member

NaTType.__new__ defines _day and _month attributes and sets them to -1. What are these used for?

https://github.com/pandas-dev/pandas/blob/master/pandas/_libs/tslib.pyx#L833

class NaTType(_NaT):
    """(N)ot-(A)-(T)ime, the time equivalent of NaN"""

    def __new__(cls):
        cdef _NaT base

        base = _NaT.__new__(cls, 1, 1, 1)
        base._day = -1
        base._month = -1
        base.value = NPY_NAT
@jreback
Copy link
Contributor

jreback commented Sep 4, 2017

NaT is a subclass of datetime
i think these are necessary but of course u can try to remove if u don't think so

jbrockmendel added a commit to jbrockmendel/pandas that referenced this issue Sep 4, 2017
@gfyoung gfyoung added Internals Related to non-user accessible pandas implementation Clean labels Sep 4, 2017
@jreback jreback added this to the 0.21.0 milestone Sep 4, 2017
jreback pushed a commit that referenced this issue Sep 4, 2017
jbrockmendel added a commit to jbrockmendel/pandas that referenced this issue Sep 10, 2017
jowens pushed a commit to jowens/pandas that referenced this issue Sep 20, 2017
alanbato pushed a commit to alanbato/pandas that referenced this issue Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants