Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sizmailov mannequin opened this issue Jul 12, 2020 · 3 comments
Closed

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

sizmailov mannequin opened this issue Jul 12, 2020 · 3 comments
Labels
type-feature A feature request or enhancement

Comments

@sizmailov
Copy link
Mannequin

sizmailov mannequin commented Jul 12, 2020

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 = []

    @sizmailov
    Copy link
    Mannequin Author

    sizmailov mannequin commented Jul 12, 2020

    MRE:

    class Property(property):
        pass

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

    Expected:
    hello

    Actual:
    None

    @rhettinger
    Copy link
    Contributor

    What would you expect this to print?

    class Property(property):
        'custom docstring'

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

    @sizmailov
    Copy link
    Mannequin Author

    sizmailov mannequin commented Jul 14, 2020

    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

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @AlexWaygood AlexWaygood added the type-feature A feature request or enhancement label Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants