deepcopy function references a non-existant variable
In copy.py: https://github.com/micropython/micropython-lib/blob/f20d89c6aad9443a696561ca2a01f7ef0c8fb302/copy/copy.py#L163 the deepcopy function references the variable dispatch_table, which isn't initialized.
copy: Provide top-level documentation.
Summary
This PR adds documentation for the copy module, explaining why the module may require some changes in the objects being copied to behave as CPython.
Unlike CPython, MicroPython does not provide default implementations for either __reduce__ or __reduce_ex__, which are used by the copy module as the fallback methods to create copies of non-trivial objects. These methods aren't provided by default to minimise both the footprint of the interpreter binary and the RAM taken by object instances.
Users who want simpler ways to allow object copies can implement __copy__ and __deepcopy__ instead, as mentioned in CPython's documentation for the copy module.
Arguably the lack of __reduce__ and __reduce_ex__ could also be mentioned in MicroPython's own documentation as part of the differences from CPython, but it doesn't hurt to mention more module-specific caveats in here too. This should, in theory, keep user expectations in check w.r.t. the behaviour of this specific module.
This should clarify scenarios like the ones mentioned in #1090.
Generative AI
I did not use generative AI tools when creating this PR.
SO? The issue is still present, and it's really unpleasant
I just reported this on pfalcon's repository which is the "official" source of this repository.
https://github.com/pfalcon/micropython-lib/issues/26