Re: [Python-Dev] argparse ugliness

2010-03-08 Thread Mark Russell
l back to the more general add_argument() call, the wrapper could just handle the usual case (default false, presence of option sets flag to True). So the signature would be pretty simple - something like: def add_bool_argument(self, help=None, dest=No

Re: [Python-Dev] PEP for Better Control of Nested Lexical Scopes

2006-02-21 Thread Mark Russell
guage I would probably also make it an error to use = to do rebinding (i.e. insist on = for new bindings, and := for rebindings). But that's obviously not reasonable for python. Mark Russell ___ Python-Dev mailing list Python-Dev@python.org htt

Re: [Python-Dev] PEP for Better Control of Nested Lexical Scopes

2006-02-21 Thread Mark Russell
NoteErrors() for item in items: if too_big(item): err("Too big") if too_small(item): err("Too small") if err.had_error: print "Some items were out of range" Any chance of := (and rem

Re: [Python-Dev] PEP for adding an sq_index slot so that any object, a or b, can be used in X[a:b] notation

2006-02-11 Thread Mark Russell
On 10 Feb 2006, at 12:45, Nick Coghlan wrote:An alternative would be to call it "__discrete__", as that is the key  characteristic of an indexing type - it consists of a sequence of discrete  values that can be isomorphically mapped to the integers. Another alternative: __as_ordinal__.  Wikipedia d

Re: [Python-Dev] Adding a conditional expression in Py3.0

2005-09-21 Thread Mark Russell
me. I think that requriing parens helps a lot with the list-of-names problem - it nicely delimits the conditional expression for human readers: return (if self.arg is None then default else self.arg) In particular it breaks up the misleading grouping

Re: [Python-Dev] Pre-PEP: Exception Reorganization for Python 3.0

2005-08-02 Thread Mark Russell
On Tue, 2005-08-02 at 11:00, Nick Coghlan wrote: > With this hierarchy, the recommended parent class for application errors > becomes Error, ... And presumably Error could also be the recommended exception for quick'n'dirty script

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Mark Russell
ods, so how about the term "bracketing object"? Mark Russell ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Updated Monkey Typing pre-PEP

2005-01-20 Thread Mark Russell
ad, file.readlines)): ... For commonly used subsets of course you'd do something like: IInputStream = interface(file.read, file.readlines) def foo(f: IInputStream): ... I can't see that interface() would need much magic - I would guess you could imp

Re: [Python-Dev] redux: fractional seconds in strptime

2005-01-14 Thread Mark Russell
database). My vote is for %N producing a microseconds field. Mark Russell ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 246, redux

2005-01-12 Thread Mark Russell
ere's a need for it, add a way to say "this adaptor can be used as part of a transitive chain" Mark Russell ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http