<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style>
<!--
@font-face
        {font-family:Calibri}
@font-face
        {font-family:Tahoma}
@font-face
        {font-family:Rockwell}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
span.hoenzb
        {}
span.EmailStyle18
        {font-family:"Rockwell","serif";
        color:#1F497D}
.MsoChpDefault
        {}
@page Section1
        {margin:1.0in 1.0in 1.0in 1.0in}
div.Section1
        {}
-->
</style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="Section1">
<p class="MsoNormal"><span style="font-family:"Rockwell","serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-family:"Rockwell","serif"; color:#1F497D"> </span></p>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> numpy-discussion-bounces@scipy.org [mailto:numpy-discussion-bounces@scipy.org]
<b>On Behalf Of </b>Olivier Delalleau<br>
<b>Sent:</b> Tuesday, November 15, 2011 10:02 AM<br>
<b>To:</b> Discussion of Numerical Python<br>
<b>Subject:</b> Re: [Numpy-discussion] numpy.int32 is not subclass of int, but numpy.int64 is</span></p>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="margin-bottom:12.0pt"> </p>
<div>
<p class="MsoNormal">2011/11/15 MACKEITH Andrew <<a href="mailto:Andrew.MACKEITH@3ds.com">Andrew.MACKEITH@3ds.com</a>></p>
<div>
<div>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style=""><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt">
<a href="mailto:numpy-discussion-bounces@scipy.org" target="_blank">numpy-discussion-bounces@scipy.org</a> [mailto:<a href="mailto:numpy-discussion-bounces@scipy.org" target="_blank">numpy-discussion-bounces@scipy.org</a>]
<b>On Behalf Of </b>Olivier Delalleau<br>
<b>Sent:</b> Tuesday, November 15, 2011 7:03 AM<br>
<b>To:</b> Discussion of Numerical Python<br>
<b>Subject:</b> Re: [Numpy-discussion] numpy.int32 is not subclass of int, but numpy.int64 is</span></p>
</div>
<p class="MsoNormal" style=""> </p>
<p class="MsoNormal" style="">2011/11/14 Robert Kern <<a href="mailto:robert.kern@gmail.com" target="_blank">robert.kern@gmail.com</a>></p>
<div>
<div>
<div>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">On Mon, Nov 14, 2011 at 20:18, MACKEITH Andrew <<a href="mailto:Andrew.MACKEITH@3ds.com" target="_blank">Andrew.MACKEITH@3ds.com</a>> wrote:<br>
> Could someone explain this?<br>
><br>
> An instance of numpy.int32 is not an instance of int or <a href="http://numpy.int" target="_blank">
numpy.int</a>.<br>
> An instance of numpy.int64 is an instance of int and <a href="http://numpy.int" target="_blank">
numpy.int</a>.<br>
><br>
> I don't know if it is a bug in my linux build.</p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">>>>> import sys<br>
>>>> sys.maxint<br>
> 9223372036854775807<br>
>>>> import platform<br>
>>>> print  platform.platform()<br>
> Linux-2.6.32.12-0.7-default-x86_64-with-SuSE-11-x86_64</p>
</div>
<p class="MsoNormal" style="">This is expected on a 64-bit platform. Note that <a href="http://numpy.int" target="_blank">
numpy.int</a> is just an<br>
alias for the builtin int type for backwards compatibility with an<br>
earlier version of numpy. We could probably remove it, since it seems<br>
to be causing more confusion than not.<br>
<br>
Anyways, we subclass the appropriately sized integer scalar type from<br>
Python's int type depending on the platform. So on a platform where<br>
Python's int type is 64-bits, numpy.int64 will include int in its<br>
inheritance tree. On platforms where the Python int type is 32-bit,<br>
numpy.int32 will include it instead.</p>
</blockquote>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style=""><br>
I'll just add that there is a numpy.integer class that is parent of both numpy.int32 and numpy.int64 (see
<a href="http://docs.scipy.org/doc/numpy/reference/arrays.scalars.html" target="_blank">
http://docs.scipy.org/doc/numpy/reference/arrays.scalars.html</a>). It's not a parent of
<a href="http://numpy.int" target="_blank">numpy.int</a> though, since as said above,
<a href="http://numpy.int" target="_blank">numpy.int</a> is an alias to the builtin int.<br>
<br>
-=- Olivier</p>
<p class="MsoNormal" style=""><span style="font-family:"Rockwell","serif"; color:#1F497D"> </span></p>
</div>
</div>
<p class="MsoNormal" style=""><span style="font-family:"Rockwell","serif"; color:#1F497D">Thanks you for the information.  numpy.integer is what I was looking for. 
</span></p>
<p class="MsoNormal" style=""><span style="font-family:"Rockwell","serif"; color:#1F497D"> </span></p>
<p class="MsoNormal" style=""><span style="font-family:"Rockwell","serif"; color:#1F497D">Is there an equivalent base class for float types?</span></p>
<p class="MsoNormal" style=""><span style="font-family:"Rockwell","serif"; color:#1F497D">Do you know where these are documented?</span></p>
<p class="MsoNormal" style=""><span style="font-family:"Rockwell","serif"; color:#1F497D"> </span><span style="color:#888888"></span></p>
<p class="MsoNormal" style=""><span style="font-family:"Rockwell","serif"; color:#1F497D">Andrew</span><span style="color:#888888"></span></p>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><br>
numpy.floating would be the one for non-complex float types (and numpy.inexact the parent for both complex and non-complex). The class hierarchy is shown in the link I provided in my previous mail.<br>
<br>
-=- Olivier</p>
<p class="MsoNormal"><span style="font-family:"Rockwell","serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-family:"Rockwell","serif"; color:#1F497D">Thanks.</span></p>
<p class="MsoNormal"><span style="font-family:"Rockwell","serif"; color:#1F497D">Andrew</span></p>
<p class="MsoNormal"><span style="font-family:"Rockwell","serif"; color:#1F497D"> </span></p>
</div>
</div>
</div>
<p style="font-size:9pt; margin:0px 0px 0px 35.4pt; color:#9d9d9d; font-style:italic; font-family:Arial,Helvetica,sans-serif">
This email and any attachments are intended solely for the use of the individual or entity to whom it is addressed and may be confidential and/or privileged.</p>
<p style="font-size:9pt; margin:0px 0px 0px 35.4pt; color:#9d9d9d; font-style:italic; font-family:Arial,Helvetica,sans-serif">
If you are not one of the named recipients or have received this email in error, </p>
<p style="font-size:9pt; margin:0px 0px 0px 35.4pt; color:#9d9d9d; font-style:italic; font-family:Arial,Helvetica,sans-serif">
(i) you should not read, disclose, or copy it,</p>
<p style="font-size:9pt; margin:0px 0px 0px 35.4pt; color:#9d9d9d; font-style:italic; font-family:Arial,Helvetica,sans-serif">
(ii) please notify sender of your receipt by reply email and delete this email and all attachments,</p>
<p style="font-size:9pt; margin:0px 0px 0px 35.4pt; color:#9d9d9d; font-style:italic; font-family:Arial,Helvetica,sans-serif">
(iii) Dassault Systemes does not accept or assume any liability or responsibility for any use of or reliance on this email.</p>
<p style="font-style:italic; margin:0px 0px 0px 35.4pt; font-family:Arial,Helvetica,sans-serif; color:#9d9d9d; font-size:9pt">
</p>
<p style="font-size:9pt; margin:0px 0px 0px 35.4pt; color:#9d9d9d; font-style:italic; font-family:Arial,Helvetica,sans-serif">
For other languages, go to http://www.3ds.com/terms/email-disclaimer </p>
</body>
</html>