Comment

Comment by jrockway

In Perl, all arguments are undef (similar to None) by default, which is pretty much the only thing you should be defaulting things to in Python. So actually, Perl makes it hard to shoot yourself in the foot, while Python has syntax for making it easy.

(We have an internal library at work that does something like:

    def __init__(self, ..., foo={}):
        self.foo = foo
Guess what happens when you change some_instance.foo. Yup, all the other instances change too!)
parent jrockway 15 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton