python-attrs / python-attrs/attrs

Extended properties

Open
#535 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

It would be a cool feature to have properties that participate in asdict method.

@attr.s
class SomeClass:

  @attr.property(asdict=True)
  def some_dynamic_attr(self):
    return True

print(asdict(SomeClass()))
>> {'some_dynamic_attr': True}

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.

Research direction

Start at the asdict entry point and inspect how attrs fields are collected and serialized. Use the issue's dynamic property example to define the expected behavior, then add coverage showing that the property appears in the resulting dictionary while existing serialization behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.