python-attrs / python-attrs/cattrs

Extra keys

Open
#580 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.1k
Forks
159
Avg merge
12h 21m
Merged PRs (30d)
6

Description

Description

Is it possible to get the keys that were not used during a call to structure(input_dict, SomeClass)?

One way would be to use forbid_extra_keys to get the names of these extra keys, but then you would have to run structure a second time if you still want to use the structured data

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 by reading the structure(input_dict, SomeClass) behavior and the forbid_extra_keys option described in the issue. Determine how unused keys could be exposed without requiring a second structuring call, and define tests that confirm both the structured data and the extra-key names are available.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.