Skip to content

Add the @cached_property decorator #65344

@thedrow

Description

@thedrow
mannequin
BPO 21145
Nosy @rhettinger, @ncoghlan, @pitrou, @vstinner, @carljm, @merwok, @alex, @bitdancer, @serhiy-storchaka, @thedrow, @sir-sigurd
PRs
  • bpo-21145: Add cached_property decorator in functools #6982
  • Files
  • cached_property.diff: diff to add cached_property decorator, with tests and docs
  • cached_property.diff: same as previous, with doc note and better error message for object with slots
  • cached_property.diff: same as previous, but thread-safe
  • 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 2018-08-30.14:04:19.713>
    created_at = <Date 2014-04-03.10:28:52.512>
    labels = ['3.8', 'type-feature', 'library']
    title = 'Add the @cached_property decorator'
    updated_at = <Date 2018-10-25.21:06:57.823>
    user = 'https://github.com/thedrow'

    bugs.python.org fields:

    activity = <Date 2018-10-25.21:06:57.823>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-08-30.14:04:19.713>
    closer = 'ncoghlan'
    components = ['Library (Lib)']
    creation = <Date 2014-04-03.10:28:52.512>
    creator = 'Omer.Katz'
    dependencies = []
    files = ['45431', '45450', '45452']
    hgrepos = []
    issue_num = 21145
    keywords = ['patch']
    message_count = 45.0
    messages = ['215439', '215488', '215564', '215654', '215655', '218750', '218760', '218761', '218762', '260308', '260312', '260319', '260321', '260322', '260323', '260324', '260326', '280534', '280541', '280542', '280547', '280597', '280601', '280602', '280608', '280609', '280610', '280615', '280616', '280655', '280657', '316535', '316643', '316745', '316760', '316851', '317096', '317097', '317100', '317101', '317103', '324212', '324383', '324386', '328493']
    nosy_count = 13.0
    nosy_names = ['rhettinger', 'ncoghlan', 'pitrou', 'vstinner', 'carljm', 'pydanny', 'eric.araujo', 'alex', 'r.david.murray', 'serhiy.storchaka', 'madison.may', 'Omer.Katz', 'sir-sigurd']
    pr_nums = ['6982']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue21145'
    versions = ['Python 3.8']

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.8 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions