Files
openide/python/testData/paramInfo/InitializingAttrs.py
Mikhail Golubev 84c48c48a9 PY-47532 Support new API and namespace of "attrs" package
GitOrigin-RevId: a8a0f909b21cc9f3b95a7b823452599374a943a9
2022-08-18 16:13:12 +00:00

74 lines
857 B
Python

import attr
import attrs
@attr.s
class A1:
x = attr.ib()
y = attr.ib()
z = attr.ib(default=0)
A1(<arg1>)
@attr.s
class A2:
x = attr.ib()
y = attr.ib(init=True)
z = attr.ib(default=0)
A2(<arg2>)
@attr.s
class A3:
x = attr.ib()
y = attr.ib(init=False)
z = attr.ib(default=0)
A3(<arg3>)
@attr.s
class B1:
x = attr.ib()
y = attr.ib()
z = attr.ib(default=attr.Factory(list))
B1(<arg4>)
@attr.attrs
class C1:
x = attr.ib()
y = attr.attr(default=0)
C1(<arg5>)
@attr.attributes
class C2:
x = attr.attr()
y = attr.attrib(default="0")
C2(<arg6>)
@attr.s
class F1:
x = attr.ib()
@x.default
def __init_x__(self):
return 1
F1(<arg7>)
@attrs.define
class B2:
x = attrs.field()
y = attrs.field()
z = attrs.field(default=attrs.Factory(list))
B2(<arg8>)