A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2015-February/138281.html below:

[Python-Dev] subclassing builtin data structures

[Python-Dev] subclassing builtin data structures [Python-Dev] subclassing builtin data structuresGeorg Brandl g.brandl at gmx.net
Sat Feb 14 20:36:26 CET 2015
On 02/14/2015 07:26 PM, Alexander Belopolsky wrote:

> In the case of int, there is a good reason for this behavior - bool.  In python,
> we want True + True == 2.  In numpy, where binary operations preserve
> subclasses, you have
> 
>>>> import numpy
>>>> numpy.bool_(1) + numpy.bool_(1)
> True

I don't think numpy.bool_ subclasses some class like numpy.int_.

Georg

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4