Easy function, please help.
jason.swails at gmail.com
Thu Feb 10 15:50:18 CET 2011
On Thu, Feb 10, 2011 at 3:31 AM, Benjamin Kaplan
<benjamin.kaplan at case.edu>wrote:
> > On Wed, Feb 9, 2011 at 5:34 PM, MRAB <python at 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
> > 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
> > both)! Still don't know much deeper than Python's cosmetic surface at
> > 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 M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Graduate Student
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list