Weird Python: Mutable Default Arguments

Опубликовано: 16 Май 2023
на канале: Sonar
247
5

Mutable Default Arguments: If you've been using Python for a while, then this one will not come as a surprise. In Python, default arguments are evaluated only once, and this happens when the function is defined. As a result, mutable objects like lists and dictionaries retain their state between function calls.

Read the full blog by Developer Advocate Nafiul Islam here:
https://www.sonarsource.com/blog/weir...

#pythonprogramming #python #fyp #coding #interpreter


Смотрите видео Weird Python: Mutable Default Arguments онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Sonar 16 Май 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 247 раз и оно понравилось 5 людям.