[Python-ideas] warnings package might provide an Option or a pre-filled OptionParser

C. Titus Brown ctb at msu.edu
Sun Feb 21 15:28:33 CET 2010

On Sun, Feb 21, 2010 at 03:16:52PM +0100, Masklinn wrote:
> On 20 Feb 2010, at 23:19 , Greg Ewing wrote:
> > 
> > Masklinn wrote:
> >> I believe it would be nice if `warnings` provided something
> >> one could simply drop into `optparse` to automagically get -W handling
> > 
> > Wouldn't this be better provided as a feature of the
> > optparse module? Otherwise you'd be making warnings
> > dependent on optparse, or at least having to know
> > about it, which seems like the wrong direction for
> > the dependency to go in.
> I don't know, I'm not sure it makes much sense for optparse to start providing pre-built options for random stuff in the stdlib does it? I feel it'd be more sensible to have each module provide its own set of pre-built Options (if it applies), plus I also believe it's more sensible documentation-wise (someone reading on how warnings works would be more likely to find the Options documentation in warnings than go to optparse and get it from there).

Isn't this conflating two things that don't belong together, though?

warnings is a Python developer issue.

optparse provides command line arguments for users to make use of.

Generally, when running things from the command line, I shouldn't care about
what language (or language version, or internal details of that language)
I'm using.

C. Titus Brown, ctb at msu.edu

More information about the Python-ideas mailing list