Hacker News new | past | comments | ask | show | jobs | submit login

These are Java design patterns. Python has different patterns. That's why people say that Factory is natural in Python.

Two examples, what i consider (very simple) Python patterns (without fancy names though):

    if __name__ == "__main__":
      ...


    def MyDecorator(func):
      def wrapper(...):
        def my_func(*args, **vargs):
           ...
        return my_func
      return wrapper



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: