Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'received:209.85.223': 0.03; 'importing': 0.05; 'sys': 0.07; 'imported': 0.09; 'override': 0.09; 'separately': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'files:': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'similarly,': 0.16; 'wrote:': 0.18; 'module': 0.19; 'thu,': 0.19; 'feb': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'bytes': 0.24; 'module,': 0.24; 'subject:problem': 0.24; 'math': 0.24; 'cc:2**0': 0.24; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'ones.': 0.31; 'run': 0.32; 'programmers': 0.33; 'could': 0.34; 'received:209.85': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'doubt': 0.36; 'received:209': 0.37; 'form,': 0.38; 'files': 0.38; '12,': 0.39; 'sure': 0.39; 'even': 0.60; 'dave': 0.60; 'sum': 0.64; 'more': 0.64; 'total': 0.65; 'here': 0.66; 'determine': 0.67; 'other.': 0.75; '2015': 0.84; 'conflicts': 0.84; "it'd": 0.84; 'obvious.': 0.84; 'angel': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=RkT99+QJWMltmx4Jpjw2Ldo6Ycow56EitA5XVbzDxxE=; b=D9um+wM0ogqSP20y1MBp0cEcOhLcC3PR8n5zVJeNM0xmi2kGXU9KNogiJfZUiMz7fO J4QQygsTz0XsD0HwpwwXe97iK6hAl33OeDLLFFTvn8NcMx+o1FkBmfP+Gug5s7Y0JYyk pCvYfIF39xje/nc+RpCs19FIRITnYpqOTEjup/fG99AfKV34+6eQsrEGP0ODeAaPh2Re Eg3hKDqGUWx8FNhWBeLn0VdljGpsaPctDAVwhoEXBE4Tywcdb8LnrbC54Niw6AlTvvOe lNrzynUe2p0lINIaANWiW5H3/h+y5PpTfHL+pzLWJR8o1PU5AncKv31jmtuoNh+bjNG6 /ogw== MIME-Version: 1.0 X-Received: by 10.50.171.201 with SMTP id aw9mr4413853igc.2.1423669037012; Wed, 11 Feb 2015 07:37:17 -0800 (PST) In-Reply-To: <54DB701A.9060203@davea.name> References: <201502110006.t1B060VZ021974@fido.openend.se> <201502110016.t1B0GVah024279@fido.openend.se> <54DB701A.9060203@davea.name> Date: Thu, 12 Feb 2015 02:37:16 +1100 Subject: Re: function inclusion problem From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1423669040 news.xs4all.nl 2846 [2001:888:2000:d::a6]:60851 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:85534 On Thu, Feb 12, 2015 at 2:07 AM, Dave Angel wrote: > Similarly, if you import from more than one module, and use the import* > form, they could conflict with each other. And the order of importing will > (usually) determine which names override which ones. Never mind about conflicts and order of importing... just try figuring out code like this: from os import * from sys import * from math import * # Calculate the total size of all files in a directory tot = 0 for path, dirs, files in walk(argv[1]): # We don't need to sum the directories separately for f in files: # getsizeof() returns a value in bytes tot += getsizeof(f)/1024.0/1024.0 print("Total directory size:", floor(tot), "MB") Now, I'm sure some of the experienced Python programmers here can see exactly what's wrong. But can everyone? I doubt it. Even if you run it, I doubt you'd get any better clue. But if you could see which module everything was imported from, it'd be pretty obvious. ChrisA