It allows references to another data structures.
DotDict: A simple Python library to make chained attributes possible
51–55 of 55 posts
Here's my personal finger exercise:
https://pypi.org/project/talamus-relatable/
Re: DotDict: A simple Python library to make chained attributes possible
#52In case anyone is looking for mature alternatives that are used in production https://pypi.org/project/python-box/ https://pypi.org/project/munch/
How does these compare to glom?
Re: DotDict: A simple Python library to make chained attributes possible
#53Re: DotDict: A simple Python library to make chained attributes possible
#54So basically Perl autovivification for Python?
Seems a subset of it. Practicality aside, Perl can autovivify not only hashes but also arrays:
my %x;
$x{foo}[1]{bar} = 42; # %x is ( foo => [ undef, { bar => 42 } ] )Re: DotDict: A simple Python library to make chained attributes possible
#55Earlier quoted context omitted.
Be aware that pickle is unsafe (as documented near the top of https://docs.python.org/3/library/pickle.html ), so prefer other serialization formats except between trusted processes
I can't remember the last time I _wanted_ to pickle something. Parquet and JSON pretty much cover it for me. I guess pickling made more sense before tools like Pydantic were good and popular? If I want all the python-specific nuance on disk, I know I'm in a bad place!
I use pickle to serialize RPC requests between internal services. Nothing beats it in terms of speed and ease of use.