shared-memory-dict
shared-memory-dict copied to clipboard
Allow SharedMemoryDict to be initialized like a regular dictionary
There is an PR suggesting the addition of *args and **kwargs in our object initialization, but I would like to discuss some points and maybe a possible postponement of this implementation to release a major version, since it can change the method signature.
Some ideas and considerations:
- Adding args and kwargs along with dictionary initialization will throw an error about creating a dictionary, wouldn't it be better for a specific non-dictionary exception?
- Today "name" is a positional or named parameter and it is mandatory. But when initializing shared memory it is not.
- Maybe we should remove serializer from
__init__
and use it from serializer module, likelogging
module. - ShareableList uses the size from the
iterator
param. Why not do the same, but optionally allow to define a size? - We should consider putting name and size as mandatory named parameters. This will imply that both cannot be used as a key. Removing the serializer from
__init__
also helps here, considering it will be one less name.
I would like to listen to your opinions @spaceone, @renanivo, @jeanmask, @itheodoro, @thyagomininelli.