I have a working solution for this issue, it is just not very pyphonic. I work in Python 2.7 and therefore cannot use Python 3 solutions.
I have a dictionary that is regularly updated. In the end, the key, let it be called "foo", with the value appears in the dictionary. I want to continue polling this object and get this dictionary until the "foo" key appears, after which I want to get the value associated with this key and use it.
Here is some psuedo code that works right now:
polled_dict = my_object.get_dict()
while('foo' not in polled_dict.keys()):
polled_dict = my_object.get_dict()
fooValue = polled_dict['foo']
Let me emphasize that the code is working now. It feels rude, but it works. The potential involution that I came up with is the following:
fooValue = None
While fooValue is None:
polled_dict = my_object.get_dict()
fooValue = polled_dict.get('foo')
, . polled_dict.get('foo') , dict ( while while), . , , , .
, , , ( - ), pythonic. , . - ? , , ?
EDIT. , . , , , , , :
" API, . . ( , ). , , , dict , - . - (, API , , , -, / API, , , .)"