Overview

attrs 24.1, released on August 3, 2024, makes the first argument of evolve() positional-only.

Main Features

evolve() positional-only

The first argument of evolve() is now positional-only, avoiding conflicts with attributes named inst.

python
import attrs

@attrs.define
class Config:
    host: str = 'localhost'
    port: int = 8000

cfg = Config()
# evolve() with positional-only first arg
new_cfg = attrs.evolve(cfg, port=9000)
print(new_cfg)  # Config(host='localhost', port=9000)

Sources