python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
dataclass references the same object rather than initializing a new one
I have a dataclass that looks like this (simplified and renamed):
@dataclass
class SharedReference:
bytes_io: BytesIO = BytesIO()
And I am running into an issue where I'm accidentally creating a ...
Zev
Votes: 0
Answers: 1
How to create a Python dataclass with a prop that depends on the output from a default_factory
I'm trying to use the dataclasses default_factory field to dynamically add a property (id) while also still being able to create a subsequent property (id_with_appended_str) whose default value depend...
Jamie.Sgro
Votes: 0
Answers: 0
What is the right way of annotating constructor of abstract class to make Mypy happy?
I have an abstract base class BsaeFoo that my dataclasses such as ChildFoo is inheriting from.
from abc import ABCMeta
from typing import Dict, Any, TypeVar, Type
from dataclasses import dataclass
Fo...
Leonardus Chen
Votes: 0
Answers: 1
Is there really a bug in using python dataclass and property together?
I have been here:
Weird Issue when using dataclass and property together
Dataclasses and property decorator
Expected behavior or a bug of python's dataclasses?
Property in dataclass
What is the recom...
Diogo
Votes: 0
Answers: 1