8000 Inconsistent documentation/superclasses of `typing.MappingView` and `typing.ItemsView` on several versions of CPython · Issue #98500 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
Inconsistent documentation/superclasses of typing.MappingView and typing.ItemsView on several versions of CPython #98500
Closed
@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

    0