Skip to content

Type of input() is not correct for Python 3 #25

@neilccbrown

Description

@neilccbrown

In Python 2 input() returned a number or string dynamically. This led to its annotation (in scopes.BuiltinNames) as returning BuiltinTypes.ANY_TYPE. In Python 3, after PEP 3111 ( https://peps.python.org/pep-3111/ ) input changed to always returning a string. Ideally I think TigerPython would dynamically alter the return type of the input function based on the Python version but I'm not sure the best way to structure this as BuiltinNames has all the functions statically determined, so it is not easy to pass in the python version during the construction.

(This is not critical for us as I think we're going to use builtins.pyi to annotate all the builtins rather than use TigerPython's set, but I thought I'd point this out.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions