Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #99855

Re: Is vars() the most useless Python built-in ever?

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Manolo Martínez <manolo@austrohungaro.com>
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 <mailman.108.1449048140.14615.python-list@python.org> (permalink)
References <565cf141$0$1612$c3e8da3$5496439d@news.astraweb.com> <20151201084416.GA2700@beagle> <n3jtei$fpa$1@ger.gmane.org> <20151201213100.GA9665@beagle.localdomain> <n3l7mi$k6g$1@ger.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace news.uni-berlin.de SIk+sgqvJCMahXtzGgjMUgG+aZrs/KK8XBR50FMcsHCQ==
Return-Path <manolo@austrohungaro.com>
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 <n3l7mi$k6g$1@ger.gmane.org>
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:99855

Show key headers only | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Is vars() the most useless Python built-in ever? Steven D'Aprano <steve@pearwood.info> - 2015-12-01 12:00 +1100
  Re: Is vars() the most useless Python built-in ever? Josef Pktd <josef.pktd@gmail.com> - 2015-11-30 19:45 -0800
  Re: Is vars() the most useless Python built-in ever? Rick Johnson <rantingrickjohnson@gmail.com> - 2015-11-30 21:54 -0800
    Re: Is vars() the most useless Python built-in ever? Marko Rauhamaa <marko@pacujo.net> - 2015-12-01 09:34 +0200
      Re: Is vars() the most useless Python built-in ever? Rick Johnson <rantingrickjohnson@gmail.com> - 2015-12-11 13:06 -0800
    Re: Is vars() the most useless Python built-in ever? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-12-01 18:55 +1100
      Re: Is vars() the most useless Python built-in ever? Rick Johnson <rantingrickjohnson@gmail.com> - 2015-12-01 12:33 -0800
        Re: Is vars() the most useless Python built-in ever? Steven D'Aprano <steve@pearwood.info> - 2015-12-02 11:57 +1100
        Re: Is vars() the most useless Python built-in ever? Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-01 22:48 -0600
          Re: Is vars() the most useless Python built-in ever? Rick Johnson <rantingrickjohnson@gmail.com> - 2015-12-11 14:13 -0800
            Re: Is vars() the most useless Python built-in ever? Steven D'Aprano <steve@pearwood.info> - 2015-12-12 15:44 +1100
              Re: Is vars() the most useless Python built-in ever? Chris Angelico <rosuav@gmail.com> - 2015-12-12 16:56 +1100
              Re: Is vars() the most useless Python built-in ever? Rick Johnson <rantingrickjohnson@gmail.com> - 2015-12-14 18:33 -0800
      Re: Is vars() the most useless Python built-in ever? Ben Finney <ben+python@benfinney.id.au> - 2015-12-02 12:47 +1100
    Re: Is vars() the most useless Python built-in ever? John Gordon <gordon@panix.com> - 2015-12-01 16:56 +0000
      Re: Is vars() the most useless Python built-in ever? Rick Johnson <rantingrickjohnson@gmail.com> - 2015-12-01 13:15 -0800
        Re: Is vars() the most useless Python built-in ever? "Albert Visser" <albert.visser@gmail.com> - 2015-12-02 19:08 +0100
    Re: Is vars() the most useless Python built-in ever? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-12-02 13:14 +1300
  Re: Is vars() the most useless Python built-in ever? eryk sun <eryksun@gmail.com> - 2015-12-01 01:22 -0600
    Re: Is vars() the most useless Python built-in ever? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-12-01 18:57 +1100
  Re: Is vars() the most useless Python built-in ever? Manolo Martínez <manolo@austrohungaro.com> - 2015-12-01 09:44 +0100
    Re: Is vars() the most useless Python built-in ever? Steven D'Aprano <steve@pearwood.info> - 2015-12-02 12:12 +1100
      Re: Is vars() the most useless Python built-in ever? Peter Otten <__peter__@web.de> - 2015-12-02 08:51 +0100
  Re: Is vars() the most useless Python built-in ever? Peter Otten <__peter__@web.de> - 2015-12-01 11:40 +0100
  Re: Is vars() the most useless Python built-in ever? Manolo Martínez <manolo@austrohungaro.com> - 2015-12-01 22:31 +0100
  Re: Is vars() the most useless Python built-in ever? Peter Otten <__peter__@web.de> - 2015-12-01 23:41 +0100
  Re: Is vars() the most useless Python built-in ever? boB Stepp <robertvstepp@gmail.com> - 2015-12-01 20:20 -0600
  Re: Is vars() the most useless Python built-in ever? wxjmfauth@gmail.com - 2015-12-01 23:46 -0800
  Re: Is vars() the most useless Python built-in ever? Serhiy Storchaka <storchaka@gmail.com> - 2015-12-02 10:22 +0200
  Re: Is vars() the most useless Python built-in ever? Manolo Martínez <manolo@austrohungaro.com> - 2015-12-02 10:09 +0100
  Re: Is vars() the most useless Python built-in ever? Chris Angelico <rosuav@gmail.com> - 2015-12-02 20:28 +1100
  Re: Is vars() the most useless Python built-in ever? Chris Angelico <rosuav@gmail.com> - 2015-12-02 20:33 +1100
  Re: Is vars() the most useless Python built-in ever? Manolo Martínez <manolo@austrohungaro.com> - 2015-12-02 10:40 +0100
  Re: Is vars() the most useless Python built-in ever? Peter Otten <__peter__@web.de> - 2015-12-02 11:48 +0100
  Re: Is vars() the most useless Python built-in ever? Chris Angelico <rosuav@gmail.com> - 2015-12-02 22:02 +1100
  Re: Is vars() the most useless Python built-in ever? eryk sun <eryksun@gmail.com> - 2015-12-02 05:34 -0600
  Re: Is vars() the most useless Python built-in ever? Serhiy Storchaka <storchaka@gmail.com> - 2015-12-04 10:42 +0200

csiph-web