Skip to main content

All Questions

Tagged with
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(...
Miguel Andrade's user avatar
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 ...
carl's user avatar
  • 623
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 ...
omid's user avatar
  • 802
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 ...
Baruc Almaguer's user avatar
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__(...
Quant Christo's user avatar