@@ -160,7 +160,7 @@ def define_what_needs_to_be_written() -> Tuple[Set[Override], Set[OverExc]]:
160160 # Actually this COULD work but creates infinite loops when a list comprehension is used in the expression [i for i in x]
161161 # so we prefer to raise an exception and tell users that list comprehensions are forbidden
162162 # to_skip.update({'__iter__'})
163- to_override_with_exception .update ({OverExc ('__iter__' )})
163+ to_override_with_exception .update ({OverExc ('__iter__' , unbound_method = iter )})
164164
165165 # ** Iterator and Generator **
166166 # .__next__
@@ -193,11 +193,11 @@ def define_what_needs_to_be_written() -> Tuple[Set[Override], Set[OverExc]]:
193193 # ** Hashable Object **
194194 # .__hash__
195195 # to_override.update(__get_all_magic_methods(Hashable))
196- to_override_with_exception .update ({OverExc ('__hash__' )})
196+ to_override_with_exception .update ({OverExc ('__hash__' , unbound_method = hash )})
197197
198198 # ** Truth-testable Object **
199199 # .__bool__
200- to_override_with_exception .update ({OverExc ('__bool__' )})
200+ to_override_with_exception .update ({OverExc ('__bool__' , unbound_method = bool )})
201201
202202 # ** Object = Field container **
203203 # .__getattribute__ (to avoid)
@@ -233,7 +233,7 @@ def define_what_needs_to_be_written() -> Tuple[Set[Override], Set[OverExc]]:
233233
234234 # ** Sized Container **
235235 # .__len__, .__length_hint__
236- to_override_with_exception .add (OverExc ('__len__' ))
236+ to_override_with_exception .add (OverExc ('__len__' , unbound_method = len ))
237237
238238 # ** Iterable Container : see Iterable **
239239 # ** Reversible Container **
0 commit comments