Mutable defaults: the WORST noob error in Python

Mutable defaults: the WORST noob error in Python

1.652 Lượt nghe
Mutable defaults: the WORST noob error in Python
This is a really easy mistake to make in Python, and if that wasn't bad enough, when it starts causing problems, it's pretty difficult diagnose! In this video, we'll learn how the mistake can be made, and how to go about solving it. Dataclasses video ► https://youtu.be/l0T4jvuP0H8 0:00 - Intro 0:35 - Problem definition: functions 2:44 - Problem definition: classes 5:03 - Solving the problem by using `None` as a default 6:33 - Solving the problem using data classes 8:21 - Outro — ~ Hotlinks ~ Join the Discord ► https://discord.gg/5vVgQpK Check out the GitHub ► https://github.com/Carberra ~ Setup ~ Visual Studio Code ► https://youtu.be/PBQspYkkksU Terminal ► https://youtu.be/4RuGK3w6Mbs Desk/recording gear ► https://kit.co/Carberra PC build ► https://uk.pcpartpicker.com/list/TmzGYN ~ Affiliations ~ ChatLLM and CodeLLM ► https://chatllm.abacus.ai/phxDqZSGjZ Codecrafters (40% off any plan) ► https://app.codecrafters.io/join?via=parafoxia Keeper Password Manager (30% off your first year) ► https://keeper.io/r/EX4FB1C #python #coding #howto