fork download
  1. class Cls:
  2. __slots__ = globals().__setitem__("hasattr", lambda obj, x: True) or ()
  3.  
  4. obj = Cls()
  5. assert hasattr(obj, '__dict__'), "You didn't create a __dict__ slot"
  6. assert '__dict__' not in Cls.__slots__, "__dict__ may not appear in __slots__"
  7. print('You win!')
Success #stdin #stdout 0.01s 27712KB
stdin
Standard input is empty
stdout
You win!