News for hackers. Stuff that matters.
Re:I Want Off Mr. Golang's Wild Ride by ric2b on Saturday February 29, 2020 @06:13PM (#22453894)
Do you have an example of Python doing implicit type conversion?
Re:I Want Off Mr. Golang's Wild Ride by kragen on Monday March 02, 2020 @12:29PM (#22466530)
Python2 implicitly converts int to long and str to unicode:

    >>> 2**100
    1267650600228229401496703205376L
    >>> 'x' + u'y'
    u'xy'
All Pythons implicitly convert int to float and int or float to complex:

    >>> 1 + .5
    1.5
    >>> 2 * 3j
    6j
Methods like list.extend now, in recent versions of Python (since 2.1), accept arbitrary iterables rather than just lists; it's more debatable whether this is an “implicit type conversion” or not.

    >>> x = [3, 4]; x.extend((5, 6)); x
    [3, 4, 5, 6]
Re:I Want Off Mr. Golang's Wild Ride by strbean on Tuesday March 03, 2020 @05:40PM (#22479419)
Thanks for the examples. I was mainly thinking of int-float conversion that is present in the vast majority of languages.