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

property to get the docstring from fget #40714

Closed
ddorfman mannequin opened this issue Aug 8, 2004 · 3 comments
Closed

property to get the docstring from fget #40714

ddorfman mannequin opened this issue Aug 8, 2004 · 3 comments
Labels
extension-modules C modules in the Modules dir

Comments

@ddorfman
Copy link
Mannequin

ddorfman mannequin commented Aug 8, 2004

BPO 1005461
Nosy @birkenfeld
Files
  • propdoc2.diff: Correcter change; doc and test the same
  • 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 = <Date 2006-05-22.10:16:12.000>
    created_at = <Date 2004-08-08.11:08:17.000>
    labels = ['extension-modules']
    title = 'property to get the docstring from fget'
    updated_at = <Date 2006-05-22.10:16:12.000>
    user = 'https://bugs.python.org/ddorfman'

    bugs.python.org fields:

    activity = <Date 2006-05-22.10:16:12.000>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Extension Modules']
    creation = <Date 2004-08-08.11:08:17.000>
    creator = 'ddorfman'
    dependencies = []
    files = ['6154']
    hgrepos = []
    issue_num = 1005461
    keywords = ['patch']
    message_count = 3.0
    messages = ['46578', '46579', '46580']
    nosy_count = 2.0
    nosy_names = ['georg.brandl', 'ddorfman']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1005461'
    versions = []

    @ddorfman
    Copy link
    Mannequin Author

    ddorfman mannequin commented Aug 8, 2004

    Allow property objects to use the fget function's docstring if a
    property docstring wasn't specified. This was suggested by
    someone on python-dev or c.l.py, but I don't remember who it was
    (sorry). Function docstrings are easier to write (read: prettier) than
    explicit doc= arguments, so this should make more properties
    have docstrings, sometimes automagically (I know it will for my
    code, anyway). It gets even better with syntatic sugar for
    decorators; read-only properties can now be defined, including
    docstring, with just one function:

      @property
        def golden(self):
            """The Golden Ratio. (Don't ask why this is a property.)"""
            return (1 + math.sqrt(5)) / 2

    The doc part of the patch also improves some markup in the
    vicinity.

    @ddorfman ddorfman mannequin closed this as completed Aug 8, 2004
    @ddorfman ddorfman mannequin added the extension-modules C modules in the Modules dir label Aug 8, 2004
    @ddorfman ddorfman mannequin closed this as completed Aug 8, 2004
    @ddorfman ddorfman mannequin added the extension-modules C modules in the Modules dir label Aug 8, 2004
    @ddorfman
    Copy link
    Mannequin Author

    ddorfman mannequin commented Aug 9, 2004

    Logged In: YES
    user_id=908995

    Oops, now that I'm sufficiently awake, it's pretty obvious that the patch
    is broken--it leaks a reference every time the new code runs. Mea culpa!
    Corrected patch attached.

    @birkenfeld
    Copy link
    Member

    Logged In: YES
    user_id=849994

    This was addressed by patch 1434038.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant