Visitar URL original
__doc__ attribute is not set in property-derived classes · Issue #85459 · python/cpython · GitHub
Skip to content

__doc__ attribute is not set in property-derived classes #85459

Description

@sizmailov
mannequin
BPO 41287
Nosy @rhettinger, @tirkarthi, @sizmailov
PRs
  • bpo-41287: Handle doc argument of property.__init__ in subclasses #23205
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2020-07-12.20:34:43.594>
    labels = []
    title = '__doc__ attribute is not set in property-derived classes'
    updated_at = <Date 2020-11-09.10:20:58.378>
    user = 'https://github.com/sizmailov'

    bugs.python.org fields:

    activity = <Date 2020-11-09.10:20:58.378>
    actor = 'Sergei Izmailov'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = []
    creation = <Date 2020-07-12.20:34:43.594>
    creator = 'Sergei Izmailov'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41287
    keywords = ['patch']
    message_count = 3.0
    messages = ['373571', '373624', '373627']
    nosy_count = 3.0
    nosy_names = ['rhettinger', 'xtreak', 'Sergei Izmailov']
    pr_nums = ['23205']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue41287'
    versions = []

    Activity

    1. sizmailov commented on Jul 12, 2020

      sizmailovmannequin
      MannequinAuthor

      MRE:

      class Property(property):
          pass

      print(Property(None, None, None, "hello").__doc__)

      Expected:
      hello

      Actual:
      None

    2. rhettinger commented on Jul 14, 2020

      @rhettinger
      Contributor

      What would you expect this to print?

      class Property(property):
          'custom docstring'

      print(Property(None, None, None, "hello").__doc__)

    3. sizmailov commented on Jul 14, 2020

      sizmailovmannequin
      MannequinAuthor
      class Property(property):
          'custom docstring'

      print(Property(None, None, None, "hello").__doc__)

      This snippet is expected to print "hello" as well (at least it's what comment in cpython implementation suggests)

      https://github.com/python/cpython/blob/master/Objects/descrobject.c#L1712-L1715

    4. transferred this issue fromon Apr 10, 2022
    5. added a commit that references this issue on May 1, 2024
      66f5add
    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

      type-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions