Expose cached property functions of slots classes via public API

Open
#1,532 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Start in src/attr/_make.py around the private cached_properties dictionary and review the linked Sphinx extension to understand the compatibility problem. Define and expose the public representation requested for slots-class cached properties, then verify that the extension can use it without relying on private implementation details.

Written by the indexing model from the issue text.

Description

I'm writing a Sphinx extension to fix #1325. It does work, but it's brittle--if practically anything changes about the way cached properties of slots classes are made, my extension will break.

I propose adding the currently private cached_properties dictionary to the public API, perhaps as an attribute like __attrs_cached_properties__.

Dominant language
Python
Stars
5.8k
Forks
480
Avg merge
2h 15m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-attrs/attrs

All issues in python-attrs/attrs

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.