4 ms·
What would it help, in Python, to have 'list of int'?
by pekk 12y ago
What would it help, in Python, to have 'list of int'?
- _yosefk 12y agoA more compact representation is one advantage - that's why numpy has array of int.
- codygman 12y agoYou don't have to validate all objects inside of that list are an int or handle cases via duck typing, exceptions, etc. As _yosefk said, the interpreter can assume a more compact representation.