Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.05; 'case.': 0.05; 'python': 0.09; '"if': 0.09; "ain't": 0.09; 'moreover,': 0.09; 'observation': 0.09; 'subject:Why': 0.09; 'bug': 0.10; 'cc:addr:python-list': 0.10; 'programmer': 0.11; 'wrote:': 0.17; 'directory.': 0.17; 'found,': 0.17; '(or': 0.18; 'module': 0.19; 'defined': 0.22; 'cc:2**0': 0.23; "i've": 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'possibly': 0.27; 'found.': 0.27; 'post': 0.28; 'inspect': 0.29; 'file': 0.32; 'handle': 0.33; 'wrong': 0.34; 'list': 0.35; 'subject:?': 0.35; "won't": 0.35; 'something': 0.35; 'list.': 0.35; 'but': 0.36; '(i.e.': 0.36; 'programmers': 0.36; 'too': 0.36; 'subject:: ': 0.38; 'object': 0.38; 'nothing': 0.38; 'your': 0.60; 'received:194': 0.61; 'back': 0.62; 'behavior': 0.64; 'applying': 0.69; 'gotten': 0.75; 'ever,': 0.84; 'pardon': 0.84; 'good,': 0.91; 'subject:remember': 0.91 X-IronPort-AV: E=Sophos;i="4.77,798,1336341600"; d="scan'208";a="664507" X-Virus-Scanned: amavisd-new at zimbra.sequans.com Date: Mon, 20 Aug 2012 16:39:47 +0200 From: Jean-Michel Pichavant User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328) MIME-Version: 1.0 To: kj Subject: Re: Why doesn't Python remember the initial directory? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345473594 news.xs4all.nl 6875 [2001:888:2000:d::a6]:45758 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27497 kj wrote: > 99.99% of Python programmers > will find that there's nothing wrong with behavior [snip] > Pardon my cynicism, but the general vibe from the replies I've > gotten to my post (i.e. "if Python ain't got it, it means you don't > need it") > [snip] Don't you find there's something wrong in applying your observation from 2 or 3 replies to your post to 99% of python programmer ? Moreover, flaming people on their own mailing list won't do you any good, ever, in any list. To get back to your original question, > inspect.getmodule? Docstring: Return the module an object was defined in, or None if not found. As getmodule may return None if not found, you need too handle that case. There's possibly a weakness in the inspect module when changing the current directory however nothing wrong with Python having the remember the intial directory. If you need to remember it, do it youself (or file a bug to inspect module authors). JM