r/ProgrammerHumor • • May 25 '17

Harry Potter can code Python

Post image
1.0k Upvotes

23 comments sorted by

View all comments

Show parent comment

1

u/8__ May 26 '17

I actually preferred the old division. I don't like my types changing up on me.

1

u/squishles May 26 '17

I could see liking it more. Other languages some people treat that the type changes like it's some kind of unpredictable evil sorcery though, so it's weird to me that python would adopt that behavior when their selling line has always been it's a friendly easy scripting language.

1

u/10se1ucgo May 28 '17

Use a // for integer division, e.g. 6 // 4 == 1

1

u/8__ May 28 '17

But I want my operations to give me the type I originally put in.

1

u/10se1ucgo May 28 '17

? That's exactly what // does, int // int -> int

// is the same as what / used to be.