Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Manolo =?iso-8859-1?Q?Mart=EDnez?= Newsgroups: comp.lang.python Subject: Re: Is vars() the most useless Python built-in ever? Date: Wed, 2 Dec 2015 10:09:54 +0100 Lines: 20 Message-ID: References: <565cf141$0$1612$c3e8da3$5496439d@news.astraweb.com> <20151201084416.GA2700@beagle> <20151201213100.GA9665@beagle.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.uni-berlin.de SIk+sgqvJCMahXtzGgjMUgG+aZrs/KK8XBR50FMcsHCQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:Python': 0.05; 'main()': 0.07; 'yeah,': 0.09; 'anyway': 0.11; 'things.': 0.15; 'argparse': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:ever': 0.16; 'subject:most': 0.16; 'suite.': 0.16; 'wrote:': 0.16; 'script.': 0.18; 'handles': 0.20; 'cheers,': 0.22; 'code.': 0.23; 'help.': 0.23; 'wrote': 0.23; 'long,': 0.24; 'written': 0.24; 'header:In-Reply-To:1': 0.24; 'script': 0.25; "i've": 0.25; 'header:User-Agent:1': 0.26; 'function': 0.28; 'looks': 0.29; "i'm": 0.30; 'true.': 0.33; 'similar': 0.33; 'correctly': 0.34; 'list': 0.34; 'could': 0.35; 'but': 0.36; 'too': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'thanks': 0.37; 'charset:us-ascii': 0.37; 'wrong': 0.38; 'mailing': 0.38; 'test': 0.39; 'subject:the': 0.39; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'tutor': 0.66; 'dear': 0.67; 'otten': 0.84; 'peter,': 0.84; 'received:82.223': 0.84; 'this...': 0.84; 'regret': 0.91 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:99855 Dear Peter, and Steven, thanks again for engaging with my script. I'm fully aware that this is not the tutor mailing list :) Peter Otten wrote: > As far as I can see in a correctly written script the AttributeError cannot > be triggered by the user as argparse handles this case automatically by > showing the help. This... is true. I could have sworn that's not the way argparse behaved when I wrote that snippet, but I've been very wrong before about similar things. Anyway my main() function looks much better now :) > By the way, I recommend coverage.py to find dead code. I have not used > it for too long, and I regret it ;) I blush to confess I would first need to write a test suite. But yeah, will do both, thanks for the recommendation. Cheers, Manolo