Skip to content

Commit 3fd8ed3

Browse files
author
smcq
committed
code cleanup, this test is useless because of http://docs.python.org/reference/datamodel.html#new-style-special-lookup I'm not sure how to handle that. I do a decent job with __call__ but some of the others are going to take more work.
1 parent 655d288 commit 3fd8ed3

File tree

1 file changed

+0
-111
lines changed

1 file changed

+0
-111
lines changed

prototype/test_prototype.py

Lines changed: 0 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -24,117 +24,6 @@ class SimpleBase(object):
2424
pass
2525

2626

27-
class TestingHowPythonWorks(unittest.TestCase):
28-
def test_what_python_lets_us_set(self):
29-
"""
30-
this is a long and tedious test to find out what python
31-
will let us hack, apparently __doc__ and __subclasscheck__ are
32-
all broken
33-
"""
34-
class Foo(object):
35-
pass
36-
37-
#Foo.__doc__ = 1 #raises
38-
Foo.__new__ = 1
39-
Foo.__init__ = 1
40-
Foo.__del__ = 1
41-
Foo.__repr__ = 1
42-
Foo.__str__ = 1
43-
Foo.__lt__ = 1
44-
Foo.__le__ = 1
45-
Foo.__eq__ = 1
46-
Foo.__ne__ = 1
47-
Foo.__gt__ = 1
48-
Foo.__ge__ = 1
49-
Foo.__cmp__ = 1
50-
Foo.__rcmp__ = 1
51-
Foo.__hash__ = 1
52-
Foo.__nonzero__ = 1
53-
Foo.__unicode__ = 1
54-
Foo.__getattr__ = 1
55-
Foo.__setattr__ = 1
56-
Foo.__delattr__ = 1
57-
Foo.__getattribute__ = 1
58-
Foo.__get__ = 1
59-
Foo.__set__ = 1
60-
Foo.__delete__ = 1
61-
Foo.__slots__ = 1
62-
Foo.__metaclass__ = 1
63-
Foo.__isinstancecheck__ = 1
64-
# Foo.__subclasscheck__ = 1 #raises
65-
Foo.__call__ = 1
66-
Foo.__len__ = 1
67-
Foo.__getitem__ = 1
68-
Foo.__setitem__ = 1
69-
Foo.__delitem__ = 1
70-
Foo.__iter__ = 1
71-
Foo.__reversed__ = 1
72-
Foo.__contains__ = 1
73-
Foo.__getslice__ = 1
74-
Foo.__setslice__ = 1
75-
Foo.__delslice__ = 1
76-
Foo.__add__ = 1
77-
Foo.__sub__ = 1
78-
Foo.__mul__ = 1
79-
Foo._floordiv__ = 1
80-
Foo.__mod__ = 1
81-
Foo.__divmod__ = 1
82-
Foo.__pow__ = 1
83-
Foo.__lshift__ = 1
84-
Foo.__rshift__ = 1
85-
Foo.__and__ = 1
86-
Foo.__xor__ = 1
87-
Foo.__or__ = 1
88-
Foo.__div__ = 1
89-
Foo.__truediv__ = 1
90-
91-
Foo.__radd__ = 1
92-
Foo.__rsub__ = 1
93-
Foo.__rmul__ = 1
94-
Foo.__rdiv__ = 1
95-
Foo.__rtruediv__ = 1
96-
Foo.__rfloordiv__ = 1
97-
Foo.__rmod__ = 1
98-
Foo.__rdivmod__ = 1
99-
Foo.__rpow__ = 1
100-
Foo.__rlshift__ = 1
101-
Foo.__rrshift__ = 1
102-
Foo.__rand__ = 1
103-
Foo.__rxor__ = 1
104-
Foo.__ror__ = 1
105-
106-
Foo.__iadd__ = 1
107-
Foo.__isub__ = 1
108-
Foo.__imul__ = 1
109-
Foo.__idiv__ = 1
110-
Foo.__itruediv__ = 1
111-
Foo.__ifloordiv__ = 1
112-
Foo.__imod__ = 1
113-
Foo.__ipow__ = 1
114-
Foo.__ilshift__ = 1
115-
Foo.__irshift__ = 1
116-
Foo.__iand__ = 1
117-
Foo.__ixor__ = 1
118-
Foo.__ior__ = 1
119-
120-
Foo.__neg__ = 1
121-
Foo.__pos__ = 1
122-
Foo.__abs__ = 1
123-
Foo.__invert__ = 1
124-
125-
Foo.__complex__ = 1
126-
Foo.__int__ = 1
127-
Foo.__long__ = 1
128-
Foo.__float__ = 1
129-
Foo.__oct__ = 1
130-
Foo.__hex__ = 1
131-
Foo.__index__ = 1
132-
Foo.__coerce__ = 1
133-
134-
Foo.__enter__ = 1
135-
Foo.__exit__ = 1
136-
137-
13827
class TestInstanceProperties(unittest.TestCase):
13928

14029
def setUp(self):

0 commit comments

Comments
 (0)