jplana/python-etcd

Improvements on method documentation

Kogelvis opened this issue · 0 comments

Hi,

I've been using this library for a couple of days now. So far it does exactly what it needs to be doing, thank you for that :)

However I feel the documentation on some methods could be improved.
For example the delete method of the Client class. It mentions it raises "KeyValue: If the key doesn't exists." When I try to write something like:

try:
    client.delete('/key', recursive=True)
except KeyValue as error:
    print(error)

Flake8 will immediately state that 'KeyValue' is an undefined name. If I try etcd.KeyValue instead pylint objects that the module etcd has no KeyValue member.
When I tried the delete method in a python shell I found that it actually raises an etcd.EtcdKeyNotFound exception.

It would be usefull if you could update this and other methods with the actual exception it raises.

Thanks in advance 👍