Кирнев Юрий, 321 группа UniSize 14060
Файзуллов Айрат Рафагатович 530 группа UniSize 14184
f1import sysf1import sys
22
n3class SizeD:n3class SizeDescriptor:
44
5    def __init__(self):5    def __init__(self):
n6        self._size = Nonen6        self._custom_value = None
77
n8    def __get__(self, obj, cls):n8    def __get__(self, instance, owner):
9        if self._size is not None:9        if self._custom_value is not None:
10            return self._size10            return self._custom_value
11        if hasattr(obj, '__len__'):11        if hasattr(instance, '__len__'):
12            return len(obj)12            return len(instance)
13        if hasattr(obj, '__abs__'):13        if hasattr(instance, '__abs__'):
14            return abs(obj)14            return abs(instance)
15        return 015        return 0
1616
n17    def __set__(self, obj, value):n17    def __set__(self, instancenew_value):
18        self._size = value18        self._custom_value = new_value
1919
n20    def __delete__(self, obj):n20    def __delete__(self, instance):
21        self._size = None21        self._custom_value = None
2222
23def sizer(cls):23def sizer(cls):
t24    cls.size = SizeD()t24    cls.size = SizeDescriptor()
25    return cls25    return cls
26exec(sys.stdin.read())26exec(sys.stdin.read())
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op