Skip to content

Nesting of containers #43

Closed
Closed
@OriolAbril

Description

@OriolAbril

I am a bit confused by the behaviour of natural language containers. Currently, list of list of str is not valid, but arguably more convoluted alternatives like list of (int, list of int)->list[int, list[int]] (not sure this is a valid type hint) or list of (str or list of str)->list[str | list[str]] are.

I think this comes from the "of qualname" piece in qualname "of" qualname _PLURAL_S? as opposed to "of type" but then there is also qualname "of" "(" union ")" with union being defined with type, not qualname and also the tuple version qualname "of" "(" type ("," type)+ ")" also with type instead of qualname.

I do have some list of list of str but I completely understand that nesting these types too much becomes incomprehensible so we want to discourage users from such patterns. I am not sure what some good alternatives could be, but I think the current situation has the potential to be quite confusing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    supportContributor & user questions

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions