The built-in functions that convert one type to another (whenever this is possible) are split into two buckets:
- The ones that can handle being called with no parameters (
bool, float, list, tuple, dict, set)
- The ones that fail whenever called with no parameters (
str, int, bytes)
In order to be consistent, I propose to allow all of these functions to be called without any parameters. This would imply that str() == "", int() == 0 and bytes() == b'' (today, all of these calls should fail).
This is behaviour would be consistent with Python.
The built-in functions that convert one type to another (whenever this is possible) are split into two buckets:
bool,float,list,tuple,dict,set)str,int,bytes)In order to be consistent, I propose to allow all of these functions to be called without any parameters. This would imply that
str() == "",int() == 0andbytes() == b''(today, all of these calls should fail).This is behaviour would be consistent with Python.