Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create json.JSONType #70584

Closed
brettcannon opened this issue Feb 21, 2016 · 5 comments
Closed

Create json.JSONType #70584

brettcannon opened this issue Feb 21, 2016 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@brettcannon
Copy link
Member

BPO 26396
Nosy @gvanrossum, @brettcannon, @jstasiak, @AnishShah
Files
  • jsontype.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/brettcannon'
    closed_at = <Date 2016-03-22.19:32:34.354>
    created_at = <Date 2016-02-21.00:44:28.552>
    labels = ['type-feature', 'library']
    title = 'Create json.JSONType'
    updated_at = <Date 2016-03-22.19:32:34.352>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2016-03-22.19:32:34.352>
    actor = 'brett.cannon'
    assignee = 'brett.cannon'
    closed = True
    closed_date = <Date 2016-03-22.19:32:34.354>
    closer = 'brett.cannon'
    components = ['Library (Lib)']
    creation = <Date 2016-02-21.00:44:28.552>
    creator = 'brett.cannon'
    dependencies = []
    files = ['42206']
    hgrepos = []
    issue_num = 26396
    keywords = ['patch']
    message_count = 5.0
    messages = ['260587', '261996', '262191', '262192', '262208']
    nosy_count = 4.0
    nosy_names = ['gvanrossum', 'brett.cannon', 'jstasiak', 'anish.shah']
    pr_nums = []
    priority = 'low'
    resolution = 'rejected'
    stage = 'patch review'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue26396'
    versions = ['Python 3.6']

    @brettcannon
    Copy link
    Member Author

    See python/typing#182 for the full details, but it should be:

    JSONType = t.Union[str, int, float, bool, None, t.Dict[str, t.Any], t.List[Any]]

    @brettcannon brettcannon self-assigned this Feb 21, 2016
    @brettcannon brettcannon added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Feb 21, 2016
    @brettcannon
    Copy link
    Member Author

    Here is a preliminary patch with docs. I didn't do any tests because I just don't know what kind of test we would want. Use isinstance() to make sure it covers the types we expect? And I'm not sure how to test the key type for mappings.

    @gvanrossum
    Copy link
    Member

    I'm fine with the patch here. Go for it!

    @brettcannon
    Copy link
    Member Author

    I'll add some tests and a note that this was added in Python 3.6 and is provisional along with the typing module.

    @brettcannon
    Copy link
    Member Author

    Based on conversations in python/typing#182 I'm closing this as rejected.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants