For reasons I don't think I understand, using the functions is "discouraged" because "someone might muck with how those functions work" and the python world, in it's perfect wisdom responded "Oh of course" instead of "That's so damn stupid, don't do that because it would be surprising to people who expect built in functions to do built in logic"
Yes but they are not equivalent. dict and list are factories; {} and [] are reified when the code is touched and then never reinitialised again. This catches out beginners and LLMs alike:
thayne|6 months ago
mrguyorama|6 months ago
mickeyp|6 months ago
https://www.inspiredpython.com/article/watch-out-for-mutable...
tpm|6 months ago