Матвеев Алексей Дмитриевич, 623 группа UniSize 13269 | 321 Мороз Виктор Владимирович UniSize 13605 | ||||
---|---|---|---|---|---|
t | 1 | def sizer(cls): | t | 1 | def sizer(cls): |
2 | 2 | ||||
3 | class Descr: | 3 | class Descr: | ||
4 | 4 | ||||
5 | def __get__(self, obj, cls): | 5 | def __get__(self, obj, cls): | ||
6 | try: | 6 | try: | ||
7 | return len(obj) | 7 | return len(obj) | ||
8 | except: | 8 | except: | ||
9 | try: | 9 | try: | ||
10 | return abs(obj) | 10 | return abs(obj) | ||
11 | except: | 11 | except: | ||
12 | return 0 | 12 | return 0 | ||
13 | cls.size = Descr() | 13 | cls.size = Descr() | ||
14 | return cls | 14 | return cls |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|