Nice way to cast a homogeneous tuple

Steven D'Aprano steve-REMOVE-THIS at cybersource.com.au
Thu Jul 29 04:28:26 EDT 2010


On Thu, 29 Jul 2010 09:21:37 +0200, Ulrich Eckhardt wrote:

> Steven D'Aprano wrote:
>> Perhaps I have been misinformed, but my understanding of C type-casts
>> is that (where possible), a cast like `int(var)` merely tells the
>> compiler to temporarily disregard the type of var and treat it as if it
>> were an int. In other words, it's a compiler instruction rather than a
>> conversion function.
> 
> You are misinformed. The result of a cast in C or C++ behaves as if a
> temporary was created:

Fair enough. Thank you.




-- 
Steven



More information about the Python-list mailing list