Avoiding Mutable Default Arguments in Python

Publicado el: 13 noviembre 2018
en el canal de: kishstats
1,159
21

From "The Hitchhiker's Guide to Python"
https://docs.python-guide.org/writing...

Default argument value is mutable.

Default argument values are `evaluated only once at function definition time`, which means that modifying the default value of the argument will affect all subsequent calls of the function.

IDE's like PyCharm will show warnings when attempting a mutable default argument.


En esta página del sitio puede ver el video en línea Avoiding Mutable Default Arguments in Python de Duración hora minuto segunda en buena calidad , que subió el usuario kishstats 13 noviembre 2018, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,159 veces y le gustó 21 a los espectadores. Disfruta viendo!