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.00:08:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Does this work with wacky code like this?
	class ClassAssignmentCanBreakChecks():
		def __init__(self, i):
			self._i = i
		def __lt__ (self, other):
			last.__class__ = OrdinaryOldInteger
			return self._i < (other._i if hasattr(other, '_i') else other)
	class OrdinaryOldInteger:
		def __init__(self, i):
			self._i = i
		def __lt__(self, other):
			return self._i < (other._i if hasattr(other, '_i') else other)
	lst = [ClassAssignmentCanBreakChecks(i) for i in range(10)]
	last = lst[-1]
It looks like it will initially say that all are the same type, and attempt that optimization, which will probably lead to unexpected results as that condition is no longer true after the first compare.
Date User Action Args
2017-03-11 00:08:37ppperrysetrecipients: + ppperry, tim.peters, vstinner, serhiy.storchaka, mdk, elliot.gorokhovsky
2017-03-11 00:08:37ppperrysetmessageid: <>
2017-03-11 00:08:37ppperrylinkissue28685 messages
2017-03-11 00:08:36ppperrycreate