Skip to content

Simple way to make individual attributes immutable? #133

@njsmith

Description

@njsmith

I'm a bad functional programmer and want to mutate parts of my classes. But it'd be nice if there were still a way to mark the parts of my class that are immutable as being immutable in a few key strokes. I usually won't bother if I have to work for it (I'm also lazy), but might catch some bugs. It seems this fits into attrs' general style. attr.ib(readonly=True)? Could be implemented as either a __setattr__ hook like frozen, or with a property.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions