Skip to content

Proposal: Consistent handling of call for not parameters for type creating built-in functions #351

Description

@lgalfaso

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions