Open Expurple opened 2 years ago
I've fiddled around with this a bit. Apparently, honest people aren't allowed to simply override __PIGS__.type.__eq__
or our_obj.__class__
. Maybe we'll have to spark a revolution in CPython and establish a new fork in order to acheive that. Or, we can try and find a way to not modify, but replace every our_obj
in to_convert
with a WorkingClass
instance that has all attributes except __class__
copied from the original object.
The only tangible result that I've achieved so far:
class WorkingClass:
pass
type = lambda instance: WorkingClass
# WorkingClass
type("Before the revolution I was a str")
# True
type("Before the revolution I was a str") == type(1917)
But this still doesn't bring direct str == int
or OurClass1 == OurClass2
.
We need to keep working towards the bright communist future!
Imperialist influence has sneaked into this package! Readme only focuses on the bourgeois concept of object equality (
set([OurClass1(), OurClass2(), OurClass2()])
), distracting users from the fact that therevolution
doesn't actually bring the promised class equality:We must: