Предизвикателства > Сляпа баба > Решения > Решението на Цветомир Гълъбов

Резултати
0 точки от тестове
1 точки от учител

1 точки общо

0 успешни теста
1 неуспешни теста
Код

 1import secret
 2import inspect
 3import re
 4
 5
 6def is_interesting(func):
 7    try:
 8        try:
 9            result = func(2)
10            if result == 4:
11                return True
12        except Exception:
13            pass
14
15        try:
16            result = func(3)
17            if result == 0:
18                return True
19        except Exception:
20            pass
21
22        try:
23            result = func(left="Hello", right="World")
24            if result == "HelloWorld":
25                return True
26        except Exception:
27            pass
28
29        func()
30    except TypeError as te:
31        if "Опаааааа, тука има нещо нередно." in str(te):
32            return True
33    except BaseException:
34        return True
35
36    return False
37
38
39def methodify(obj=secret, depth=0):
40    interesting_methods = tuple()
41    for name, attr in inspect.getmembers(obj):
42        if (
43            depth > 0
44            and callable(attr)
45            and len(name) == 1
46            and re.match(r"^[62493]$", name)
47            and is_interesting(attr)
48        ):
49            interesting_methods += (name,)
50            continue
51        elif (
52            depth > 0
53            and isinstance(inspect.getattr_static(obj, name), staticmethod)
54            and len(name) == 1
55            and re.match(r"^[62493]$", name)
56        ):
57            interesting_methods += (name,)
58            continue
59        elif isinstance(attr, object) and "clue" in name:
60            find_deeper_methods = methodify(attr, depth + 1)
61            interesting_methods += find_deeper_methods
62    return interesting_methods

F
======================================================================
FAIL: test_metodify (test.TestMethodify)
Test metodify function.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 12, in test_metodify
self.assertIn(methodify(), _RESULTS.keys())
AssertionError: ('2', '3', '4', '6', '4', '9') not found in dict_keys([(<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_2 at 0x7fa849e36dd0>, <function method_3 at 0x7fa849e36e60>, <function method_4 at 0x7fa849e36ef0>, <function method_5 at 0x7fa849e36f80>, <function method_6 at 0x7fa849e37010>, <function method_7 at 0x7fa849e370a0>, <function method_8 at 0x7fa849e37130>, <function method_9 at 0x7fa849e371c0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_2 at 0x7fa849e36dd0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_2 at 0x7fa849e36dd0>, <function method_4 at 0x7fa849e36ef0>, <function method_4 at 0x7fa849e36ef0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_5 at 0x7fa849e36f80>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_9 at 0x7fa849e371c0>, <function method_5 at 0x7fa849e36f80>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_5 at 0x7fa849e36f80>, <function method_0 at 0x7fa849e36cb0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_8 at 0x7fa849e37130>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_0 at 0x7fa849e36cb0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_4 at 0x7fa849e36ef0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_2 at 0x7fa849e36dd0>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_3 at 0x7fa849e36e60>, <function method_1 at 0x7fa849e36d40>, <function method_5 at 0x7fa849e36f80>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_3 at 0x7fa849e36e60>, <function method_1 at 0x7fa849e36d40>, <function method_6 at 0x7fa849e37010>, <function method_5 at 0x7fa849e36f80>, <function method_0 at 0x7fa849e36cb0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_3 at 0x7fa849e36e60>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_4 at 0x7fa849e36ef0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_3 at 0x7fa849e36e60>, <function method_2 at 0x7fa849e36dd0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_9 at 0x7fa849e371c0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_2 at 0x7fa849e36dd0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_4 at 0x7fa849e36ef0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_9 at 0x7fa849e371c0>, <function method_7 at 0x7fa849e370a0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_3 at 0x7fa849e36e60>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_3 at 0x7fa849e36e60>, <function method_4 at 0x7fa849e36ef0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_8 at 0x7fa849e37130>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_2 at 0x7fa849e36dd0>, <function method_5 at 0x7fa849e36f80>, <function method_5 at 0x7fa849e36f80>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_0 at 0x7fa849e36cb0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_1 at 0x7fa849e36d40>, <function method_5 at 0x7fa849e36f80>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_5 at 0x7fa849e36f80>, <function method_5 at 0x7fa849e36f80>, <function method_0 at 0x7fa849e36cb0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_4 at 0x7fa849e36ef0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_3 at 0x7fa849e36e60>, <function method_0 at 0x7fa849e36cb0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_3 at 0x7fa849e36e60>, <function method_1 at 0x7fa849e36d40>, <function method_5 at 0x7fa849e36f80>, <function method_9 at 0x7fa849e371c0>, <function method_2 at 0x7fa849e36dd0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_0 at 0x7fa849e36cb0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_9 at 0x7fa849e371c0>, <function method_7 at 0x7fa849e370a0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_2 at 0x7fa849e36dd0>, <function method_3 at 0x7fa849e36e60>, <function method_7 at 0x7fa849e370a0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_5 at 0x7fa849e36f80>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_1 at 0x7fa849e36d40>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_8 at 0x7fa849e37130>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_3 at 0x7fa849e36e60>, <function method_6 at 0x7fa849e37010>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_0 at 0x7fa849e36cb0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_7 at 0x7fa849e370a0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_9 at 0x7fa849e371c0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_1 at 0x7fa849e36d40>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_3 at 0x7fa849e36e60>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_4 at 0x7fa849e36ef0>, <function method_9 at 0x7fa849e371c0>, <function method_3 at 0x7fa849e36e60>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_3 at 0x7fa849e36e60>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_7 at 0x7fa849e370a0>, <function method_5 at 0x7fa849e36f80>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_0 at 0x7fa849e36cb0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_7 at 0x7fa849e370a0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_5 at 0x7fa849e36f80>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_3 at 0x7fa849e36e60>, <function method_9 at 0x7fa849e371c0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_3 at 0x7fa849e36e60>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_4 at 0x7fa849e36ef0>, <function method_9 at 0x7fa849e371c0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_8 at 0x7fa849e37130>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_2 at 0x7fa849e36dd0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_6 at 0x7fa849e37010>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_7 at 0x7fa849e370a0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_1 at 0x7fa849e36d40>, <function method_6 at 0x7fa849e37010>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_5 at 0x7fa849e36f80>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_6 at 0x7fa849e37010>, <function method_7 at 0x7fa849e370a0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_0 at 0x7fa849e36cb0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_4 at 0x7fa849e36ef0>, <function method_1 at 0x7fa849e36d40>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_5 at 0x7fa849e36f80>, <function method_1 at 0x7fa849e36d40>, <function method_3 at 0x7fa849e36e60>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_7 at 0x7fa849e370a0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_4 at 0x7fa849e36ef0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_1 at 0x7fa849e36d40>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_4 at 0x7fa849e36ef0>, <function method_6 at 0x7fa849e37010>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_0 at 0x7fa849e36cb0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_2 at 0x7fa849e36dd0>, <function method_0 at 0x7fa849e36cb0>, <function method_4 at 0x7fa849e36ef0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_5 at 0x7fa849e36f80>, <function method_3 at 0x7fa849e36e60>, <function method_2 at 0x7fa849e36dd0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_2 at 0x7fa849e36dd0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_2 at 0x7fa849e36dd0>, <function method_1 at 0x7fa849e36d40>, <function method_6 at 0x7fa849e37010>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_1 at 0x7fa849e36d40>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_3 at 0x7fa849e36e60>, <function method_1 at 0x7fa849e36d40>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_4 at 0x7fa849e36ef0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_7 at 0x7fa849e370a0>, <function method_1 at 0x7fa849e36d40>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_9 at 0x7fa849e371c0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_9 at 0x7fa849e371c0>, <function method_9 at 0x7fa849e371c0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_0 at 0x7fa849e36cb0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_2 at 0x7fa849e36dd0>, <function method_4 at 0x7fa849e36ef0>, <function method_1 at 0x7fa849e36d40>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_5 at 0x7fa849e36f80>, <function method_9 at 0x7fa849e371c0>, <function method_1 at 0x7fa849e36d40>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_2 at 0x7fa849e36dd0>, <function method_1 at 0x7fa849e36d40>, <function method_3 at 0x7fa849e36e60>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_5 at 0x7fa849e36f80>, <function method_6 at 0x7fa849e37010>, <function method_8 at 0x7fa849e37130>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_2 at 0x7fa849e36dd0>, <function method_1 at 0x7fa849e36d40>, <function method_1 at 0x7fa849e36d40>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_3 at 0x7fa849e36e60>, <function method_0 at 0x7fa849e36cb0>, <function method_7 at 0x7fa849e370a0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_3 at 0x7fa849e36e60>, <function method_4 at 0x7fa849e36ef0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_4 at 0x7fa849e36ef0>, <function method_3 at 0x7fa849e36e60>, <function method_0 at 0x7fa849e36cb0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_5 at 0x7fa849e36f80>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_7 at 0x7fa849e370a0>, <function method_8 at 0x7fa849e37130>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_0 at 0x7fa849e36cb0>, <function method_7 at 0x7fa849e370a0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_2 at 0x7fa849e36dd0>, <function method_1 at 0x7fa849e36d40>, <function method_5 at 0x7fa849e36f80>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_2 at 0x7fa849e36dd0>, <function method_5 at 0x7fa849e36f80>, <function method_2 at 0x7fa849e36dd0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_3 at 0x7fa849e36e60>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_9 at 0x7fa849e371c0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_8 at 0x7fa849e37130>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_4 at 0x7fa849e36ef0>, <function method_0 at 0x7fa849e36cb0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_7 at 0x7fa849e370a0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_3 at 0x7fa849e36e60>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_5 at 0x7fa849e36f80>, <function method_2 at 0x7fa849e36dd0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_8 at 0x7fa849e37130>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_9 at 0x7fa849e371c0>, <function method_2 at 0x7fa849e36dd0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_2 at 0x7fa849e36dd0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_2 at 0x7fa849e36dd0>, <function method_7 at 0x7fa849e370a0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_9 at 0x7fa849e371c0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_2 at 0x7fa849e36dd0>, <function method_2 at 0x7fa849e36dd0>, <function method_3 at 0x7fa849e36e60>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_4 at 0x7fa849e36ef0>, <function method_0 at 0x7fa849e36cb0>, <function method_9 at 0x7fa849e371c0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_8 at 0x7fa849e37130>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_3 at 0x7fa849e36e60>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_2 at 0x7fa849e36dd0>, <function method_0 at 0x7fa849e36cb0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_2 at 0x7fa849e36dd0>, <function method_2 at 0x7fa849e36dd0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_8 at 0x7fa849e37130>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_2 at 0x7fa849e36dd0>, <function method_4 at 0x7fa849e36ef0>, <function method_2 at 0x7fa849e36dd0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_1 at 0x7fa849e36d40>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_3 at 0x7fa849e36e60>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_3 at 0x7fa849e36e60>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_5 at 0x7fa849e36f80>, <function method_7 at 0x7fa849e370a0>, <function method_1 at 0x7fa849e36d40>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_0 at 0x7fa849e36cb0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_3 at 0x7fa849e36e60>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_9 at 0x7fa849e371c0>, <function method_2 at 0x7fa849e36dd0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_5 at 0x7fa849e36f80>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_7 at 0x7fa849e370a0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_3 at 0x7fa849e36e60>, <function method_8 at 0x7fa849e37130>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_8 at 0x7fa849e37130>, <function method_5 at 0x7fa849e36f80>, <function method_5 at 0x7fa849e36f80>, <function method_3 at 0x7fa849e36e60>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_1 at 0x7fa849e36d40>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_7 at 0x7fa849e370a0>, <function method_2 at 0x7fa849e36dd0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_7 at 0x7fa849e370a0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_9 at 0x7fa849e371c0>, <function method_8 at 0x7fa849e37130>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_4 at 0x7fa849e36ef0>, <function method_2 at 0x7fa849e36dd0>, <function method_6 at 0x7fa849e37010>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_7 at 0x7fa849e370a0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_3 at 0x7fa849e36e60>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_1 at 0x7fa849e36d40>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_0 at 0x7fa849e36cb0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_7 at 0x7fa849e370a0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_9 at 0x7fa849e371c0>, <function method_2 at 0x7fa849e36dd0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_2 at 0x7fa849e36dd0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_2 at 0x7fa849e36dd0>, <function method_0 at 0x7fa849e36cb0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_0 at 0x7fa849e36cb0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_7 at 0x7fa849e370a0>, <function method_1 at 0x7fa849e36d40>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_5 at 0x7fa849e36f80>, <function method_1 at 0x7fa849e36d40>, <function method_4 at 0x7fa849e36ef0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_0 at 0x7fa849e36cb0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_3 at 0x7fa849e36e60>, <function method_4 at 0x7fa849e36ef0>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_3 at 0x7fa849e36e60>, <function method_5 at 0x7fa849e36f80>, <function method_6 at 0x7fa849e37010>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_2 at 0x7fa849e36dd0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_9 at 0x7fa849e371c0>, <function method_6 at 0x7fa849e37010>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_3 at 0x7fa849e36e60>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_1 at 0x7fa849e36d40>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_1 at 0x7fa849e36d40>, <function method_8 at 0x7fa849e37130>, <function method_7 at 0x7fa849e370a0>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_5 at 0x7fa849e36f80>, <function method_2 at 0x7fa849e36dd0>, <function method_6 at 0x7fa849e37010>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_7 at 0x7fa849e370a0>, <function method_M at 0x7fa849e36b90>, <function method_I at 0x7fa849e36c20>, <function method_0 at 0x7fa849e36cb0>, <function method_6 at 0x7fa849e37010>, <function method_0 at 0x7fa849e36cb0>, <function method_0 at 0x7fa849e36cb0>, <function method_2 at 0x7fa849e36dd0>, <function method_1 at 0x7fa849e36d40>, <function method_8 at 0x7fa849e37130>), (<function method_F at 0x7fa849e36a70>, <function method_N at 0x7fa849e36b00>, <function method_6 at 0x7fa849e37010>, <function method_2 at 0x7fa849e36dd0>, <function method_4 at 0x7fa849e36ef0>, <function method_8 at 0x7fa849e37130>, <function method_7 at 0x7fa849e370a0>)])

----------------------------------------------------------------------
Ran 1 test in 0.003s

FAILED (failures=1)

Дискусия
История

f1import secretf1import secret
2import inspect2import inspect
3import re3import re
44
55
6def is_interesting(func):6def is_interesting(func):
7    try:7    try:
8        try:8        try:
9            result = func(2)9            result = func(2)
10            if result == 4:10            if result == 4:
11                return True11                return True
12        except Exception:12        except Exception:
13            pass13            pass
1414
15        try:15        try:
16            result = func(3)16            result = func(3)
17            if result == 0:17            if result == 0:
18                return True18                return True
19        except Exception:19        except Exception:
20            pass20            pass
2121
22        try:22        try:
23            result = func(left="Hello", right="World")23            result = func(left="Hello", right="World")
24            if result == "HelloWorld":24            if result == "HelloWorld":
25                return True25                return True
26        except Exception:26        except Exception:
27            pass27            pass
2828
29        func()29        func()
30    except TypeError as te:30    except TypeError as te:
31        if "Опаааааа, тука има нещо нередно." in str(te):31        if "Опаааааа, тука има нещо нередно." in str(te):
32            return True32            return True
33    except BaseException:33    except BaseException:
34        return True34        return True
3535
36    return False36    return False
3737
3838
39def methodify(obj=secret, depth=0):39def methodify(obj=secret, depth=0):
40    interesting_methods = tuple()40    interesting_methods = tuple()
41    for name, attr in inspect.getmembers(obj):41    for name, attr in inspect.getmembers(obj):
42        if (42        if (
43            depth > 043            depth > 0
44            and callable(attr)44            and callable(attr)
45            and len(name) == 145            and len(name) == 1
46            and re.match(r"^[62493]$", name)46            and re.match(r"^[62493]$", name)
47            and is_interesting(attr)47            and is_interesting(attr)
48        ):48        ):
49            interesting_methods += (name,)49            interesting_methods += (name,)
50            continue50            continue
51        elif (51        elif (
52            depth > 052            depth > 0
53            and isinstance(inspect.getattr_static(obj, name), staticmethod)53            and isinstance(inspect.getattr_static(obj, name), staticmethod)
54            and len(name) == 154            and len(name) == 1
55            and re.match(r"^[62493]$", name)55            and re.match(r"^[62493]$", name)
56        ):56        ):
57            interesting_methods += (name,)57            interesting_methods += (name,)
58            continue58            continue
59        elif isinstance(attr, object) and "clue" in name:59        elif isinstance(attr, object) and "clue" in name:
60            find_deeper_methods = methodify(attr, depth + 1)60            find_deeper_methods = methodify(attr, depth + 1)
61            interesting_methods += find_deeper_methods61            interesting_methods += find_deeper_methods
62    return interesting_methods62    return interesting_methods
t63 t
64 
65result = methodify()
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op

f1import secretf1import secret
2import inspect2import inspect
3import re3import re
44
55
6def is_interesting(func):6def is_interesting(func):
7    try:7    try:
8        try:8        try:
9            result = func(2)9            result = func(2)
10            if result == 4:10            if result == 4:
11                return True11                return True
12        except Exception:12        except Exception:
13            pass13            pass
1414
15        try:15        try:
16            result = func(3)16            result = func(3)
17            if result == 0:17            if result == 0:
18                return True18                return True
19        except Exception:19        except Exception:
20            pass20            pass
2121
22        try:22        try:
23            result = func(left="Hello", right="World")23            result = func(left="Hello", right="World")
24            if result == "HelloWorld":24            if result == "HelloWorld":
25                return True25                return True
26        except Exception:26        except Exception:
27            pass27            pass
2828
29        func()29        func()
30    except TypeError as te:30    except TypeError as te:
31        if "Опаааааа, тука има нещо нередно." in str(te):31        if "Опаааааа, тука има нещо нередно." in str(te):
32            return True32            return True
33    except BaseException:33    except BaseException:
34        return True34        return True
3535
36    return False36    return False
3737
3838
39def methodify(obj=secret, depth=0):39def methodify(obj=secret, depth=0):
40    interesting_methods = tuple()40    interesting_methods = tuple()
41    for name, attr in inspect.getmembers(obj):41    for name, attr in inspect.getmembers(obj):
42        if (42        if (
43            depth > 043            depth > 0
44            and callable(attr)44            and callable(attr)
45            and len(name) == 145            and len(name) == 1
n46            and re.match(r"^[A-Z0-9]$", name)n46            and re.match(r"^[62493]$", name)
47            and is_interesting(attr)47            and is_interesting(attr)
48        ):48        ):
49            interesting_methods += (name,)49            interesting_methods += (name,)
50            continue50            continue
51        elif (51        elif (
52            depth > 052            depth > 0
53            and isinstance(inspect.getattr_static(obj, name), staticmethod)53            and isinstance(inspect.getattr_static(obj, name), staticmethod)
54            and len(name) == 154            and len(name) == 1
t55            and re.match(r"^[A-Z0-9]$", name)t55            and re.match(r"^[62493]$", name)
56        ):56        ):
57            interesting_methods += (name,)57            interesting_methods += (name,)
58            continue58            continue
59        elif isinstance(attr, object) and "clue" in name:59        elif isinstance(attr, object) and "clue" in name:
60            find_deeper_methods = methodify(attr, depth + 1)60            find_deeper_methods = methodify(attr, depth + 1)
61            interesting_methods += find_deeper_methods61            interesting_methods += find_deeper_methods
62    return interesting_methods62    return interesting_methods
6363
6464
65result = methodify()65result = methodify()
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op

f1import secretf1import secret
2import inspect2import inspect
3import re3import re
44
55
6def is_interesting(func):6def is_interesting(func):
7    try:7    try:
8        try:8        try:
9            result = func(2)9            result = func(2)
10            if result == 4:10            if result == 4:
11                return True11                return True
12        except Exception:12        except Exception:
13            pass13            pass
1414
15        try:15        try:
16            result = func(3)16            result = func(3)
17            if result == 0:17            if result == 0:
18                return True18                return True
19        except Exception:19        except Exception:
20            pass20            pass
2121
22        try:22        try:
23            result = func(left="Hello", right="World")23            result = func(left="Hello", right="World")
24            if result == "HelloWorld":24            if result == "HelloWorld":
25                return True25                return True
26        except Exception:26        except Exception:
27            pass27            pass
2828
29        func()29        func()
30    except TypeError as te:30    except TypeError as te:
31        if "Опаааааа, тука има нещо нередно." in str(te):31        if "Опаааааа, тука има нещо нередно." in str(te):
32            return True32            return True
33    except BaseException:33    except BaseException:
34        return True34        return True
3535
36    return False36    return False
3737
3838
n39def methodify(obj=secret):n39def methodify(obj=secret, depth=0):
40    interesting_methods = tuple()40    interesting_methods = tuple()
41    for name, attr in inspect.getmembers(obj):41    for name, attr in inspect.getmembers(obj):
42        if (42        if (
nn43            depth > 0
43            callable(attr)44            and callable(attr)
44            and len(name) == 145            and len(name) == 1
45            and re.match(r"^[A-Z0-9]$", name)46            and re.match(r"^[A-Z0-9]$", name)
46            and is_interesting(attr)47            and is_interesting(attr)
47        ):48        ):
48            interesting_methods += (name,)49            interesting_methods += (name,)
49            continue50            continue
50        elif (51        elif (
nn52            depth > 0
51            isinstance(inspect.getattr_static(obj, name), staticmethod)53            and isinstance(inspect.getattr_static(obj, name), staticmethod)
52            and len(name) == 154            and len(name) == 1
53            and re.match(r"^[A-Z0-9]$", name)55            and re.match(r"^[A-Z0-9]$", name)
54        ):56        ):
55            interesting_methods += (name,)57            interesting_methods += (name,)
56            continue58            continue
57        elif isinstance(attr, object) and "clue" in name:59        elif isinstance(attr, object) and "clue" in name:
t58            find_deeper_methods = methodify(attr)t60            find_deeper_methods = methodify(attr, depth + 1)
59            interesting_methods += find_deeper_methods61            interesting_methods += find_deeper_methods
60    return interesting_methods62    return interesting_methods
6163
6264
63result = methodify()65result = methodify()
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op

f1import secretf1import secret
2import inspect2import inspect
3import re3import re
44
55
6def is_interesting(func):6def is_interesting(func):
7    try:7    try:
8        try:8        try:
9            result = func(2)9            result = func(2)
10            if result == 4:10            if result == 4:
11                return True11                return True
12        except Exception:12        except Exception:
13            pass13            pass
1414
15        try:15        try:
16            result = func(3)16            result = func(3)
17            if result == 0:17            if result == 0:
18                return True18                return True
19        except Exception:19        except Exception:
20            pass20            pass
2121
22        try:22        try:
23            result = func(left="Hello", right="World")23            result = func(left="Hello", right="World")
24            if result == "HelloWorld":24            if result == "HelloWorld":
25                return True25                return True
26        except Exception:26        except Exception:
27            pass27            pass
2828
29        func()29        func()
30    except TypeError as te:30    except TypeError as te:
31        if "Опаааааа, тука има нещо нередно." in str(te):31        if "Опаааааа, тука има нещо нередно." in str(te):
32            return True32            return True
33    except BaseException:33    except BaseException:
34        return True34        return True
3535
36    return False36    return False
3737
3838
39def methodify(obj=secret):39def methodify(obj=secret):
40    interesting_methods = tuple()40    interesting_methods = tuple()
41    for name, attr in inspect.getmembers(obj):41    for name, attr in inspect.getmembers(obj):
42        if (42        if (
43            callable(attr)43            callable(attr)
44            and len(name) == 144            and len(name) == 1
45            and re.match(r"^[A-Z0-9]$", name)45            and re.match(r"^[A-Z0-9]$", name)
46            and is_interesting(attr)46            and is_interesting(attr)
47        ):47        ):
48            interesting_methods += (name,)48            interesting_methods += (name,)
49            continue49            continue
50        elif (50        elif (
51            isinstance(inspect.getattr_static(obj, name), staticmethod)51            isinstance(inspect.getattr_static(obj, name), staticmethod)
52            and len(name) == 152            and len(name) == 1
53            and re.match(r"^[A-Z0-9]$", name)53            and re.match(r"^[A-Z0-9]$", name)
54        ):54        ):
55            interesting_methods += (name,)55            interesting_methods += (name,)
56            continue56            continue
t57        elif isinstance(attr, object) and "Clue" in name:t57        elif isinstance(attr, object) and "clue" in name:
58            find_deeper_methods = methodify(attr)58            find_deeper_methods = methodify(attr)
59            interesting_methods += find_deeper_methods59            interesting_methods += find_deeper_methods
60    return interesting_methods60    return interesting_methods
6161
6262
63result = methodify()63result = methodify()
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op

f1import secretf1import secret
2import inspect2import inspect
3import re3import re
44
55
6def is_interesting(func):6def is_interesting(func):
7    try:7    try:
8        try:8        try:
9            result = func(2)9            result = func(2)
10            if result == 4:10            if result == 4:
11                return True11                return True
12        except Exception:12        except Exception:
13            pass13            pass
1414
15        try:15        try:
16            result = func(3)16            result = func(3)
17            if result == 0:17            if result == 0:
18                return True18                return True
19        except Exception:19        except Exception:
20            pass20            pass
2121
22        try:22        try:
23            result = func(left="Hello", right="World")23            result = func(left="Hello", right="World")
24            if result == "HelloWorld":24            if result == "HelloWorld":
25                return True25                return True
26        except Exception:26        except Exception:
27            pass27            pass
2828
29        func()29        func()
30    except TypeError as te:30    except TypeError as te:
31        if "Опаааааа, тука има нещо нередно." in str(te):31        if "Опаааааа, тука има нещо нередно." in str(te):
32            return True32            return True
33    except BaseException:33    except BaseException:
34        return True34        return True
3535
36    return False36    return False
3737
3838
39def methodify(obj=secret):39def methodify(obj=secret):
40    interesting_methods = tuple()40    interesting_methods = tuple()
n41 n
42    for name, attr in inspect.getmembers(obj):41    for name, attr in inspect.getmembers(obj):
43        if (42        if (
44            callable(attr)43            callable(attr)
45            and len(name) == 144            and len(name) == 1
46            and re.match(r"^[A-Z0-9]$", name)45            and re.match(r"^[A-Z0-9]$", name)
47            and is_interesting(attr)46            and is_interesting(attr)
48        ):47        ):
49            interesting_methods += (name,)48            interesting_methods += (name,)
nn49            continue
50        elif (50        elif (
51            isinstance(inspect.getattr_static(obj, name), staticmethod)51            isinstance(inspect.getattr_static(obj, name), staticmethod)
52            and len(name) == 152            and len(name) == 1
53            and re.match(r"^[A-Z0-9]$", name)53            and re.match(r"^[A-Z0-9]$", name)
54        ):54        ):
55            interesting_methods += (name,)55            interesting_methods += (name,)
nn56            continue
56        elif isinstance(attr, object) and "clue" in name:57        elif isinstance(attr, object) and "Clue" in name:
57            find_deeper_methods = methodify(attr)58            find_deeper_methods = methodify(attr)
58            interesting_methods += find_deeper_methods59            interesting_methods += find_deeper_methods
n59 n
60    return interesting_methods60    return interesting_methods
6161
6262
63result = methodify()63result = methodify()
t64print(result)t
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op

f1import secretf1import secret
2import inspect2import inspect
3import re3import re
44
55
6def is_interesting(func):6def is_interesting(func):
7    try:7    try:
8        try:8        try:
9            result = func(2)9            result = func(2)
10            if result == 4:10            if result == 4:
11                return True11                return True
12        except Exception:12        except Exception:
13            pass13            pass
1414
15        try:15        try:
16            result = func(3)16            result = func(3)
17            if result == 0:17            if result == 0:
18                return True18                return True
19        except Exception:19        except Exception:
20            pass20            pass
2121
22        try:22        try:
23            result = func(left="Hello", right="World")23            result = func(left="Hello", right="World")
24            if result == "HelloWorld":24            if result == "HelloWorld":
25                return True25                return True
26        except Exception:26        except Exception:
27            pass27            pass
2828
29        func()29        func()
30    except TypeError as te:30    except TypeError as te:
31        if "Опаааааа, тука има нещо нередно." in str(te):31        if "Опаааааа, тука има нещо нередно." in str(te):
32            return True32            return True
33    except BaseException:33    except BaseException:
34        return True34        return True
3535
36    return False36    return False
3737
3838
39def methodify(obj=secret):39def methodify(obj=secret):
40    interesting_methods = tuple()40    interesting_methods = tuple()
4141
42    for name, attr in inspect.getmembers(obj):42    for name, attr in inspect.getmembers(obj):
43        if (43        if (
44            callable(attr)44            callable(attr)
45            and len(name) == 145            and len(name) == 1
46            and re.match(r"^[A-Z0-9]$", name)46            and re.match(r"^[A-Z0-9]$", name)
47            and is_interesting(attr)47            and is_interesting(attr)
48        ):48        ):
49            interesting_methods += (name,)49            interesting_methods += (name,)
50        elif (50        elif (
51            isinstance(inspect.getattr_static(obj, name), staticmethod)51            isinstance(inspect.getattr_static(obj, name), staticmethod)
52            and len(name) == 152            and len(name) == 1
53            and re.match(r"^[A-Z0-9]$", name)53            and re.match(r"^[A-Z0-9]$", name)
54        ):54        ):
55            interesting_methods += (name,)55            interesting_methods += (name,)
t56        elif isinstance(attr, object) and "Clue" in name:t56        elif isinstance(attr, object) and "clue" in name:
57            find_deeper_methods = methodify(attr)57            find_deeper_methods = methodify(attr)
58            interesting_methods += find_deeper_methods58            interesting_methods += find_deeper_methods
5959
60    return interesting_methods60    return interesting_methods
6161
6262
63result = methodify()63result = methodify()
64print(result)64print(result)
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op

f1import secretf1import secret
2import inspect2import inspect
3import re3import re
44
55
6def is_interesting(func):6def is_interesting(func):
7    try:7    try:
8        try:8        try:
9            result = func(2)9            result = func(2)
10            if result == 4:10            if result == 4:
11                return True11                return True
12        except Exception:12        except Exception:
13            pass13            pass
1414
15        try:15        try:
16            result = func(3)16            result = func(3)
17            if result == 0:17            if result == 0:
18                return True18                return True
19        except Exception:19        except Exception:
20            pass20            pass
2121
22        try:22        try:
23            result = func(left="Hello", right="World")23            result = func(left="Hello", right="World")
24            if result == "HelloWorld":24            if result == "HelloWorld":
25                return True25                return True
26        except Exception:26        except Exception:
27            pass27            pass
2828
29        func()29        func()
30    except TypeError as te:30    except TypeError as te:
31        if "Опаааааа, тука има нещо нередно." in str(te):31        if "Опаааааа, тука има нещо нередно." in str(te):
32            return True32            return True
33    except BaseException:33    except BaseException:
34        return True34        return True
3535
36    return False36    return False
3737
3838
n39def methodify(obj=secret, path=""):n39def methodify(obj=secret):
40    interesting_methods = set()40    interesting_methods = tuple()
4141
42    for name, attr in inspect.getmembers(obj):42    for name, attr in inspect.getmembers(obj):
n43        full_path = f"{path}.{name}" if path else namen
44        if (43        if (
45            callable(attr)44            callable(attr)
46            and len(name) == 145            and len(name) == 1
47            and re.match(r"^[A-Z0-9]$", name)46            and re.match(r"^[A-Z0-9]$", name)
48            and is_interesting(attr)47            and is_interesting(attr)
49        ):48        ):
n50            interesting_methods.add(name)n49            interesting_methods += (name,)
51        elif (50        elif (
52            isinstance(inspect.getattr_static(obj, name), staticmethod)51            isinstance(inspect.getattr_static(obj, name), staticmethod)
53            and len(name) == 152            and len(name) == 1
54            and re.match(r"^[A-Z0-9]$", name)53            and re.match(r"^[A-Z0-9]$", name)
55        ):54        ):
n56            interesting_methods.add(name)n55            interesting_methods += (name,)
57        elif isinstance(attr, object) and "Clue" in name:56        elif isinstance(attr, object) and "Clue" in name:
t58            find_deeper_methods = methodify(attr, full_path)t57            find_deeper_methods = methodify(attr)
59            interesting_methods.update(find_deeper_methods)58            interesting_methods += find_deeper_methods
6059
61    return interesting_methods60    return interesting_methods
6261
6362
64result = methodify()63result = methodify()
65print(result)64print(result)
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op