In vanilla Python to create a class which, when initiated, would also initiate another class I would use __init__(self):
class SomeClass:
__init__(self, token: str):
self.token = token
client = WebClient(auth=self.token)
But in attrs, I can't do this. The following yields an error because it is passing a _CountringAttr object, not the resolved string.
@attr.s()
class SomeClass:
token: str = attr.ib()
client = WebClient(auth=token)
What is the "right" way of accomplishing this?