hltcoe / concrete-python

Python modules and scripts for working with Concrete, a data serialization format for NLP
https://concrete-python.readthedocs.io
Other
20 stars 8 forks source link

The containers in comm_container.py should implement __contains__ #7

Open cash opened 4 years ago

cash commented 4 years ago

If they don't, getitem is called twice. When using the fetch wrapper one, it ends up calling the remote service twice per request. This is because of the way CommunicationContainerFetchHandler is implemented where it first tests if the item is in the mapping and then retrieves it. Another option is to change this handler's implementation to try to access and handle the error if it is not there.