What's the correct way to use 'import requests as' in Python? or Why do some scripts use 'import requ

20 Replies, 2049 Views

It’s a trade-off between brevity and clarity. *import requests as req* is short but still recognizable. If you’re using the library a LOT, the keystroke savings add up.

But if someone’s new to Python, they might not immediately connect "req" with "requests." So, weigh who’s reading your code.

Messages In This Thread



Users browsing this thread: 1 Guest(s)