python / python/cpython

dataclass init=False field with default works but default_factory does not

Open
#89,529 5 comments 1 reaction 1 assignee View on GitHub

@ericvsmith is already working on this.

Since Aug 16, 2024.

stdlib topic-dataclasses type-feature
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

BPO 45366
Nosy @ericvsmith, @sobolevn, @akulakov

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 = None
created_at = <Date 2021-10-04.20:17:33.399>
labels = ['ctypes', 'type-bug', '3.9']
title = 'dataclass init=False field with default works but default_factory does not'
updated_at = <Date 2021-11-08.01:28:02.575>
user = 'https://bugs.python.org/simplecoder878'

bugs.python.org fields:

activity = <Date 2021-11-08.01:28:02.575>
actor = 'andrei.avk'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['ctypes']
creation = <Date 2021-10-04.20:17:33.399>
creator = 'simple_coder878'
dependencies = []
files = []
hgrepos = []
issue_num = 45366
keywords = []
message_count = 4.0
messages = ['403182', '403183', '403206', '405920']
nosy_count = 4.0
nosy_names = ['eric.smith', 'sobolevn', 'andrei.avk', 'simple_coder878']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue45366'
versions = ['Python 3.9']

Linked PRs
  • gh-123070

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.