Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library

Comment by mananaysiempre

2 days ago

It’s still useful in related situations. The following crime often finds its way into my $PYTHONSTARTUP:

  class more:
      def __ror__(self, other):
          import pydoc
          pydoc.pager(str(other))
  more = more()

and here the low precedence of | is useful.

0 comments

mananaysiempre

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities