Style question: Importing modules from packages
Tim Delaney
timothy.c.delaney at gmail.com
Wed Dec 3 06:15:19 EST 2014
More information about the Python-list mailing list
Wed Dec 3 06:15:19 EST 2014
- Previous message (by thread): Style question: Importing modules from packages - 'from' vs 'as'
- Next message (by thread): Style question: Importing modules from packages - 'from' vs 'as'
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 3 December 2014 at 22:02, Chris Angelico <rosuav at gmail.com> wrote: > > import os.path as path > from os import path > Bah - deleted the list and sent directly to Chris ... time to go to bed. The advantage of the former is that if you want to use a different name, it's a smaller change. But the disadvantage of the former is that if you *don't* want to rename, it violates DRY (don't repeat yourself). The difference is so marginal that I'd leave it to personal preference, and wouldn't pull someone up for either in a code review. Tim Delaney -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-list/attachments/20141203/bc31568e/attachment.html>
- Previous message (by thread): Style question: Importing modules from packages - 'from' vs 'as'
- Next message (by thread): Style question: Importing modules from packages - 'from' vs 'as'
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list