Skip to content

Commit cd8f60b

Browse files
authored
Document workaround for python keyword conflicts (#67)
1 parent 8e5eb66 commit cd8f60b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

exoscale/api/v2.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@
3737
'id': '8561ee34-09f0-42da-a765-abde807f944b',
3838
'link': '/v2/sks-cluster/8561ee34-09f0-42da-a765-abde807f944b',
3939
'command': 'get-sks-cluster'}}
40+
41+
In case of a conflict between argument names and Python keywords, **kwargs syntax can be used:
42+
43+
>>> from exoscale.api.v2 import Client
44+
>>> c = Client("api-key", "api-secret", zone="ch-gva-2")
45+
>>> c.list_events(**{"from": "2025-03-01"})
46+
[{'handler': 'authenticate', 'source-ip': 'x.x.x.x', 'message': 'User user@exoscale.com: authenticate', 'status': 200, 'timestamp': '2025-03-10T14:52:34Z'}, {'handler': 'create session', 'source-ip': 'x.x.x.x', 'message': 'User user@exoscale.com: create session', 'status': 200, 'timestamp': '2025-03-10T14:52:46Z'}]
4047
"""
4148

4249
import copy

0 commit comments

Comments
 (0)