Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Neil Cerutti Newsgroups: comp.lang.python Subject: Re: import syntax Date: 30 Jul 2013 13:03:32 GMT Organization: Norwich University Lines: 31 Message-ID: References: <51F6C720.2020404@Gmail.com> <20130729152051.46003bcf@bigbox.christie.dr> <51F6CF36.7080702@Gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: individual.net 3ezKKtzEYSIlvtNvbJOzcQ5vn9cScdskcvkNRXbmIOXlWmfbiB Cancel-Lock: sha1:/qPTad1jDqtpKurwkaHlznX0Yxs= User-Agent: slrn/0.9.9p1/mm/ao (Win32) Xref: csiph.com comp.lang.python:51552 On 2013-07-29, Joshua Landau wrote: > Sure, just as one light is no brighter or dimmer than another > when disregarding luminosity. > > As people have said, it improves diffs as well. It flows > quicker into the "from module import things" form (which I oft > prefer), too. > > When asking these questions, ask yourself "why would it > *compile* differently? It wouldn't. Plus, premature > optimisation is the root of all evil. > > 1) Write your code > 2) If it's slow: > 2a) Do you have time? If so: > 2b) Is it important to speed up, or is the slowness not worth spending the > hours fixing? > 2c) Profile it to see what's actually slow > 2d) Realise that the slow part is not what you thought it was > 2e) Fix the bit that's slow (and nothing else) > 2f) Repeat from 2 > 3) Write some more code 1a) Does it work? 1b) Can you prove it? It's best to at least have some regression tests before you start refactoring and optimizing. -- Neil Cerutti