r/learnpython • u/mayankkaizen • Oct 13 '15
Entire Python Language in a Single Image!
Check this link for the image. Take a large print out!
54
23
10
15
2
Oct 13 '15
Boolean should be a sub-class of integer. Basically everything should be under Class, but they instead decided to shoehorn it in at the bottom.
2
u/cdcformatc Oct 13 '15
Does python have type casting? int('42') isn't a cast.
2
u/raylu Oct 13 '15
It's commonly referred to as a cast.
3
u/cdcformatc Oct 13 '15
I've only heard it referred to as a conversion. A cast doesn't modify the value, or change it any way, it just tells the compiler to treat the value at that memory location as a different type.
str(False)changes the value to something else.1
u/JohnnyJordaan Oct 14 '15
Indeed and thus casting is something impossible to do in python as you work with objects for all data types. A castable object would have to guarantee its memory pattern would be compatible for usaga as another object, I don't see that happening.
1
Oct 13 '15
I dunno, maybe I'm missing something crucial because I'm still a beginner and don't really understand yet, but this image just confused me so much.
1
38
u/JohnnyJordaan Oct 13 '15
Quite an overstatement, I would call this 'Python beginner's tutorial lessons 1 to 10 in one image'... Even
breakis not included in flow control... Jeez.