This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ppperry
Recipients elliot.gorokhovsky, mdk, ppperry, serhiy.storchaka, tim.peters, vstinner
Date 2017-03-11.15:12:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
What about if one of the relevant comparison functions is implemented in C?

        class WackyComparator(int):
		def __lt__(self, other):
			elem.__class__ = WackyList2
			return int.__lt__(self, other)

	class WackyList1(list):pass
	class WackyList2(list):
		def __lt__(self, other):
			raise ValueError
	lst =
	elem = lst[-1]

This code raises ValueError, and caching seems like it would cache the
comparator for WackyList1 objects, which is the same as the comparator for
'list' objects -- and midway through comparison, one of them changes type
to WackyList2, which has its own (broken) comparison function.

Python is very very dynamic ...
Date User Action Args
2017-03-11 15:12:31ppperrysetrecipients: + ppperry, tim.peters, vstinner, serhiy.storchaka, mdk, elliot.gorokhovsky
2017-03-11 15:12:31ppperrylinkissue28685 messages
2017-03-11 15:12:30ppperrycreate