On Thu, Jan 17, 2013 at 5:19 PM, Olivier Delalleau <sh...@keba.be> wrote: > 2013/1/16 <josef.p...@gmail.com>: >> On Wed, Jan 16, 2013 at 10:43 PM, Patrick Marsh >> <patrickmars...@gmail.com> wrote:
>> I could live with an exception for lossy down casting in this case. I'm not sure what the idea here is -- would you only get an exception if the value was such that the downcast would be lossy? If so, a major -1 The other option would be to always raise an exception if types would cause a downcast, i.e: arr = np.zeros(shape, dtype-uint8) arr2 = arr + 30 # this would raise an exception arr2 = arr + np.uint8(30) # you'd have to do this That sure would be clear and result if few errors of this type, but sure seems verbose and "static language like" to me. > Long story short, +1 for warning, -1 for exception, and +1 for a > config flag that allows one to change to exceptions by default, if > desired. is this for value-dependent or any casting of this sort? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion