In order to ensure that sub-classing works as you'd expect it to work, ``attrs`` also walks the class hierarchy and collects the attributes of all super-classes.
Once ``attrs`` knows what attributes it has to work on, it writes the requested dunder methods and attaches them to your class.
To be very clear: if you define a class with a single attribute without a default value, the generated ``__init__`` will look *exactly* how you'd expect:
..doctest::
>>> import attr, inspect
>>> @attr.s
... class C:
... x = attr.ib()
>>> print(inspect.getsource(C.__init__))
def __init__(self, x):
self.x = x
<BLANKLINE>
No magic, no meta programming, no expensive introspection at runtime.
****
Everything until this point happens exactly *once* when the class is defined.
As soon as a class is done, it's done.
And it's just a regular Python class like any other, except for a single ``__attrs_attrs__`` attribute that can be used for introspection or for writing your own tools and decorators on top of ``attrs`` (like :func:`attr.asdict`.
And once you start instantiating your classes, ``attrs`` is out of your way completely.
This **static** approach was very much a design goal of ``attrs`` and what I strongly believe makes it distinct.