Skip to content

Inconsistent documentation/superclasses of typing.MappingView and typing.ItemsView on several versions of CPython #98500

@SimpleArt

Description

@SimpleArt

Bug Report / Documentation

On the documentation for typing.MappingView and typing.ItemsView, it states that we should have:

import typing

assert issubclass(typing.MappingView, typing.Iterable)
assert issubclass(typing.MappingView, typing.Sized)

when in fact we actually have:

import collections.abc
import typing

assert typing.MappingView.mro() == [collections.abc.MappingView, collections.abc.Sized, object]

and similarly, we actually have:

import typing

assert issubclass(typing.ItemsView, typing.AbstractSet)

for python >= 3.7 on the versions I tried (3.7.9, 3.8.5, 3.9.5, and 3.10.0). On python = 3.5.4 and python = 3.6.8, I get the types for typing.MappingView consistent with the documentation, but inconsistent types for typing.ItemsView.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy