Skip to content

COMPAT: extension dtypes (DatetimeTZ, Categorical) are now Singleton cached objects #13285

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
wants to merge 1 commit into from

Conversation

jreback
Copy link
Contributor

@jreback jreback commented May 25, 2016

allows for proper is / == comparisons
Had this odd semantic difference as these were really different objects (though they DID hash the same)
This doesn't actually affect any user code.

In [1]: from pandas.core import common as com

In [2]: t1 = com.DatetimeTZDtype('datetime64[ns, US/Eastern]')

In [3]: t2 = com.DatetimeTZDtype('datetime64[ns, US/Eastern]')

In [4]: t1 == t2
Out[4]: True

In [5]: t1 is t2
Out[5]: False

In [6]: hash(t1)
Out[6]: 5756291921003024619

In [7]: hash(t2)
Out[7]: 5756291921003024619

@jreback jreback added Bug Compat pandas objects compatability with Numpy or Python functions labels May 25, 2016
@jreback jreback added this to the 0.18.2 milestone May 25, 2016
…cached objects

allows for proper is / == comparisons
@codecov-io
Copy link

Current coverage is 84.20%

Merging #13285 into master will increase coverage by <.01%

@@             master     #13285   diff @@
==========================================
  Files           138        138          
  Lines         50591      50607    +16   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          42592      42613    +21   
+ Misses         7999       7994     -5   
  Partials          0          0          

Powered by Codecov. Last updated by 8749273...fd09c61

@jreback jreback closed this in a67ac2a May 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Compat pandas objects compatability with Numpy or Python functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants