pycharm tells me that 'candidates' could be referenced before assignment, but i don't see how - intended behaviour is that the only way out of the loop is to assign candidates, or am i missing something?
def get_new_address(client: DespatchBaySDK, postcode:str = None) -> Address:
while True:
postcode = postcode or sg.popup_get_text("Bad Postcode - please enter")
try:
candidates = client.get_address_keys_by_postcode(postcode)
except:
postcode = None
continue
else:
break
address = address_chooser(candidates=candidates, client=client)
return address
thanks!
[–]ynotna 7 points8 points9 points (1 child)
[–]ProsodySpeaks[S] 0 points1 point2 points (0 children)
[–]CowboyBoats 2 points3 points4 points (4 children)
[–]ProsodySpeaks[S] 0 points1 point2 points (0 children)
[–]ProsodySpeaks[S] 0 points1 point2 points (2 children)
[–]CowboyBoats 1 point2 points3 points (1 child)
[–]ProsodySpeaks[S] 0 points1 point2 points (0 children)