All Questions
Tagged with python-attrs oop
5
questions
0
votes
0
answers
32
views
Different objects are preserving the state using attrs
I'm making some experiments using attrs, but I'm experiencing some unexpected behaviors in the following code:
I created a class as this one:
@define
class User:
name = field()
errors = field(...
1
vote
1
answer
192
views
Problem with initiating base with child class while working with python-attrs module
I'm trying to create Model class with attrs module. In my script CollectionModel class is inherited in User class. So logically all the attributes in the CollectionModel should be available in the ...
0
votes
1
answer
826
views
Is there "on_getattr" equivalent functionality for attrs package?
I use attrs package for my entities and it works like a charm in most cases. An issue I faced is in defining getter for attributes (generally in pure python @property is the goto)
for setter attrs has ...
0
votes
1
answer
182
views
Is there a way to resolve statically this circular dependencies?
I have some python classes that relate to one another, they attempt to mimic a graphql schema (The schema itself is not relevant, I post here the base case to reproduce the issue).
The GraphQL schema ...
1
vote
1
answer
1k
views
attrs library and super
Here is a toy example of class that I want to refactor. In reality I've much more parameters/attributes like momentum, so a lot of code repetition:
class TransformBl(tf.keras.Model):
def __init__(...