Easy function, please help.

Jason Swails 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
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110210/f395cd88/attachment.html>


More information about the Python-list mailing list