Skip to content

Unnecessary attrs in NaTType? #17429

Closed
@jbrockmendel

Description

@jbrockmendel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    CleanInternalsRelated to non-user accessible pandas implementation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions