<br><br><div class="gmail_quote">On Jan 7, 2008 12:00 PM, Travis E. Oliphant <<a href="mailto:oliphant@enthought.com">oliphant@enthought.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">Charles R Harris wrote:<br>> Hi All,<br>><br>> I'm thinking that one way to make the automatic type conversion a bit<br>> safer to use would be to add a CASTABLE flag to arrays. Then we could
<br>> write something like<br>><br>> a[...] = typecast(b)<br>><br>> where typecast returns a view of b with the CASTABLE flag set so that<br>> the assignment operator can check whether to implement the current
<br>> behavior or to raise an error. Maybe this could even be part of the<br>> dtype scalar, although that might cause a lot of problems with the<br>> current default conversions. What do folks think?<br><br></div>
</div>That is an interesting approach.    The issue raised of having to<br>convert lines of code that currently work (which does implicit casting)<br>would still be there (like ndimage), but it would not cause unnecessary
<br>data copying, and would help with this complaint (that I've heard before<br>and have some sympathy towards).<br><br>I'm intrigued.</blockquote><div> </div><div>Maybe  we could also set a global flag, typesafe, that in the current Numpy version would default to false, giving current behavior, but could be set true to get the new behavior. Then when Numpy 
1.1 comes out we could make the global default true. That way folks could keep the current code working until they are ready to use the typesafe feature.<br><br>Chuck<br></div></div><br>