On Thu, Feb 10, 2011 at 3:31 AM, Benjamin Kaplan <benjamin.kap...@case.edu>wrote:
> > > On Wed, Feb 9, 2011 at 5:34 PM, MRAB <pyt...@mrabarnett.plus.com> wrote: > > >>> Or typecast to an int if you want to neglect decimals before converting > >>> to a string, etc. > >>> > >> [snip] > >> Python doesn't have typecasting. :-) > > > > Because these basic types are not mutable? <excuse> Most of my work has > to > > be in Fortran, so I'm a relative newcomer to Python. When I don't need > > Fortran-y performance it's much nicer (obviously to anyone that's used > them > > both)! Still don't know much deeper than Python's cosmetic surface at > this > > point. </excuse> > > > > Not exactly. It's because everything in Python is an object. What > you're doing isn't type casting. It's just calling an object > constructor- no different than any other class in the language. > Ah, makes sense, thanks. Most of what I see/work in is C and Fortran -- not much OOP there :) --Jason -- > http://mail.python.org/mailman/listinfo/python-list > -- Jason M. Swails Quantum Theory Project, University of Florida Ph.D. Graduate Student 352-392-4032
-- http://mail.python.org/mailman/listinfo/python-list