FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

warnings.deprecated leads to incorrectly set _is_protocol on subclasses · Issue #138010 · python/cpython · GitHub

/ cpython Public

warnings.deprecated leads to incorrectly set _is_protocol on subclasses #138010

Description

Bug report

Bug description:

from warnings import deprecated
from typing import Protocol


class FooProtocol(Protocol):
    pass

class Base:
    pass

@deprecated("")
class DeprecatedBase:
    pass

class FooWithBase(Base, FooProtocol):
    pass

class FooWithDeprecatedBase(DeprecatedBase, FooProtocol):
    pass


assert FooWithBase._is_protocol is False
assert FooWithDeprecatedBase._is_protocol is True

CPython versions tested on:

3.13

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL