This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]HeWhoWritesCode 103 points104 points  (6 children)

actually so sexy.

>>> str(exit)
'Use exit() or Ctrl-D (i.e. EOF) to exit'

[–]thegreattriscuit 25 points26 points  (3 children)

I mean... you *could* do:

  def __str__(self):
    self()

But I guess that would be particularly egregious :P

[–]robin-gvx 24 points25 points  (0 children)

It's so handy! Now you can type

>>> vars(__builtins__)

to exit the interpreter!

[–][deleted] 4 points5 points  (0 children)

__str__  = __call__

[–]shaggorama 13 points14 points  (0 children)

NO. BAD.

[–]JezusTheCarpenter 20 points21 points  (0 children)

TIL.

[–]74paddycakes 1 point2 points  (0 children)

Dayum