Python 3 | Default Mutable Arguments are a thing! #python3 #coding #programming

preview_player
Показать описание
Default Mutable Arguments are a thing in Python, and are a bit on the weird side, here's how they work!
Рекомендации по теме
Комментарии
Автор

In my opinion this is more of a quirk than a feature and I would never try to utilise it- if you need state you should be using classes. This is a nightmare waiting to happen. I only ever use mutable default arguments if I'm lazy and know I definitely will not be mutating the object.

officellama
Автор

Looks like lists used in functional programming.

eispunkt
welcome to shbcf.ru