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

18 Replies, 1724 Views

I alias liberally, but only if it improves readability. *import requests as req* is fine, but I’ve seen people do *import requests as r*, and that’s where it gets ugly.

Tools like PyCharm or VSCode can show you the original import on hover, so aliasing isn’t as scary for newcomers. But still, keep it sensible.

Messages In This Thread



Users browsing this thread: 1 Guest(s)