Skip to content

Replace @properties, consider using attrs #477

Open
@c24t

Description

@c24t

Many classes needlessly wrap attributes in @propertys, e.g.

class Foo(object):
    def __init__(bar):
        self._bar = bar

    @property
    def bar(self):
        """The current bar value"""
        return self._bar

These should be replaced with plain old attributes.

While we're doing this, we should consider using the attrs library, which would let us remove some boilerplate code and provides AutoValue-style immutable value classes when we actually do want to protect certain attributes.

However, using attrs would mean adding a dependency on another third party library and making the code less readable (and more magical).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions