Skip to content

Missing data attribute in UserDict, UserList and UserString #1759

Closed

Description

@Kentzo

All three classes define the data attribute and it's definition is missing in typeshed.

Activity

  1. changed the title [-]Missing data attribute UserDict, UserList and UserString[/-] [+]Missing data attribute in UserDict, UserList and UserString[/+] on Nov 21, 2017
  2. gossrock commented on Dec 4, 2017

    @gossrock
    Contributor

    A few notes:
    UserDict, UserList and UserString are Python2 only.

    the files in question would be:
    https://github.com/python/typeshed/blob/master/stdlib/2/UserDict.pyi
    https://github.com/python/typeshed/blob/master/stdlib/2/UserList.pyi
    https://github.com/python/typeshed/blob/master/stdlib/2/UserString.pyi

    UserList.pyi and UserString.pyi have almost no annotation, so confirmed here.
    UserDict.pyi has some and the UserDict class has the following definition:

    class UserDict(Dict[_KT, _VT], Generic[_KT, _VT]):
        data = ...  # type: Mapping[_KT, _VT]
    
        def __init__(self, initialdata: Mapping[_KT, _VT] = ...) -> None: ...
    
    # TODO: __iter__ is not available for UserDict
    

    so data does exist for UserDict (though there may be some reason why it is still failing.)

    @Kentzo do you have any code that should work but is failing?

  3. Kentzo commented on Dec 4, 2017

    @Kentzo
    ContributorAuthor

    I encountered the UserData.data problem in PyCharm. Perhaps I had an outdated version back then.

  4. added
    stubs: incomplete
    on Oct 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stubs: incomplete

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions