12

What kind of seizure of insanity led the devs of Python to believe that static, mutable default parameters could be a good idea? You can literally share whole arrays between multiple calls of the same function with the same input, and the number of cases where a sane person would intentionally want to do that is FUCKING ZERO.

Comments
  • 2
    Same glitch is with dictionaries.

    Here is explanation why.

    https://stackoverflow.com/questions...
  • 2
    Hurray for mutable global state \o/
  • 0
    You know, I really like Python, but this I consider an insane flaw.

    I'm with the comments on the linked StackOverflow answer. This is not natural or necessary behaviour.
  • 0
    @VaderNT yeah, it's behaviour that nobody expects. That alone should be enough to make it different, let alone the potential for mindboggling bugs.
Add Comment