Skip to content

Commit 7e29df8

Browse files
committed
Fix conflict with administrate. Closes #98
1 parent e4de5b1 commit 7e29df8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/pycall/pytypeobject_wrapper.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,18 @@ def ===(other)
5151

5252
def <(other)
5353
case other
54+
when self
55+
false
5456
when PyTypeObjectWrapper
5557
__pyptr__ < other.__pyptr__
58+
when Class
59+
false if other.ancestors.include?(self)
60+
when Module
61+
if ancestors.include?(other)
62+
true
63+
elsif other.ancestors.include?(self)
64+
false
65+
end
5666
else
5767
raise TypeError, "compared with non class/module"
5868
end

0 commit comments

Comments
 (0)