1
future_to_url = {executor.submit(getHotelURLs, url): url for url in cityURLs}

The above code is from an concurrent.futures example in https://docs.python.org/3/library/concurrent.futures.html

It seems to me that a for loop is used in a dictionary. I am wondering if there is a documentation about this?

1

1 Answer 1

1

This is dict comprehensions. You should view the doc of list comprehensions (it works similar to dict comprehension)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.