heri16
heri16
Not sure whether the solution here should belong in the library. http://stackoverflow.com/questions/1271320/reseting-generator-object-in-python Seems to be good for retry to cater for side-effects.
Seems to be affecting simple iterators too.
Cloning an iterator seems possible in python. http://stackoverflow.com/questions/20086679/python-itertools-tee-clones-and-caching ```python import itertools # Side effect of Retrying is generator is not rewound on every retry attempt. # Workaround when Retrying does...
We could have a `clone=True` flag in `tenacity.Retrying.__init__` that turns on argument checking , (only first-level) during `call()`. ```python need_cloning = [arg for arg in args if inspect.isgenerator(arg)] ``` Or...
I would prefer the context manager to be more Pythonic: ``` with tenacity.Retrying(func, ...) as func_result: print(func_result.http_statuscode) ``` OR ``` with tenacity.Retrying(...)(func, args) as func_result: print(func_result.http_statuscode) ```
@jd I see what you mean. I relooked at redo's context-manager documentation and produced 4 pull requests to review.
Good point. Generators uses exceptions internally. we would need to clone the generator first (itertools.tee) and then catch anything other than the StopIteration or GeneratorExit exception.
Wow, brave. The compiled binaries must be pretty big.
@astewart-twist Could you try renaming requirements.txt to requirements-docker.txt so that gordon does not automatically pick it up.
This project is also based on CodeMirror: https://github.com/sparksuite/simplemde-markdown-editor