Hacker News new | ask | show | jobs
by icebraining 2980 days ago
Well, booleans are integers, so you can do:

    >>> True + 1
    2
2 comments

  fizzbuzz = lambda n: [print((“fizz” * m % 3 == 0) + (“buzz” * m % 5 == 0) or m) for m in range(n)]
Not sure if this is great or terrible
That's not "coercion", though. That's Python obeying the LSP, because bool is a subclass of int.