Re: [Python-Dev] Typo in itertools.dropwhile()

2007-07-13 Thread Chris Monson
Actually, I think it *is* a typo:  the last part should read that no
output is produced until the predicate becomes *false*.

- C


On 7/13/07, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
>
> [Matthieu on itertools.dropwhile() docs]
> > Make an iterator that drops elements from the iterable as long as the
> predicate is true; afterwards, returns every element. Note,
> > the iterator does not produce any output until the predicate is true, so
> it may have a lengthy start-up time.
> >
> > It says something and then the opposite, so which one is true ?
>
>
> It is correct as written.  Given a sequence where predicate is true 1000
> times and then alternately false and true, it returns the
> part that is alternately false and true.  So, it did DROP (omit, not return,
> skip-over, etc) the first 1000 true items and it did
> return EVERY element from the first false to the end.  It did not produce
> any output for the first 1000 inputs so it took a while to
> get to the first output (the first false).  Hope that clears it up for you.
>
>
> Raymond
> ___
> 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/shiblon%40gmail.com
>
___
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] Add a -z interpreter flag to execute a zip file

2007-07-13 Thread Chris Monson
(Sorry about top-posting: I'm using my blackberry while waiting for
the bus and my gmail client doesn't do quoting :-( )

Certainly java won't let you specify -jar more than once, because that
would be telling it to *run* two files.  It *will*, however, let you
specify more than one jar in the classpath.  This is done all the
time, making the contents of those jars available for importing.

These aren't typically combined, since the whole point of running a
jar file is to have a single distributed package, but IIRC it is not
prohibited.

- C



On 7/12/07, Neal Norwitz <[EMAIL PROTECTED]> wrote:
> On 7/12/07, Fred L. Drake, Jr. <[EMAIL PROTECTED]> wrote:
> >
> > Phillip Eby:
> >  > Testing your package before you zip it, would be one.  :)  My
> >  > personal main interest was in being able to add an item to sys.path
> >  > without having to set $PYTHONPATH on Windows.  That's why I'd like it
> >  > to be possible to use -z more than once (or whatever the option ends up
> >  > as).
> >
> > What happens if multiple entries contain __main__.py entries?  I don't
> like
> > this one so much.  I don't know what Java does if you specify -jar more
> than
> > once; that might suggest something.
>
> You can't with:
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_11-b03, mixed mode)
>
> -help says:
>  or  java [-options] -jar jarfile [args...]
>(to execute a jar file)
>
> args are passed to the jarfile being run.
>
> $ java -jar xalan2.jar -jar xalan2.jar
> Invalid option: -jar
> Invalid option: xalan2.jar
>
> n
> ___
> 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/shiblon%40gmail.com
>
___
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] Incorrect documentation of the raw_input built-in function

2008-01-26 Thread Chris Monson
Incodentally, I think your example is wrong.  It should be either

psql >/dev/null 2>&1

or

psql &>/dev/null

Notice the reversal of redirects in the first one.

Of course, this doesn't change anything about the core discussion...

- C



On 1/24/08, Isaac Morland <[EMAIL PROTECTED]> wrote:
> On Thu, 24 Jan 2008, [EMAIL PROTECTED] wrote:
>
> >Mike> 2. Is this really the hard-coded behavior we want?  I don't think
> >Mike>my use-case is that odd; in fact, what I find very odd is that
> >Mike>the prompt output is send to stderr.  I mean, I'm printing the
> >Mike>prompt for a question, not some error message. Can there not
> at
> >Mike>least be an optional parameter to indicate that you want the
> >Mike>output sent to stdout rather than stderr?
> >
> > I can think of situations where you don't want the output to go to stdout
> > either (suppose it's the regular output of the file you want to save to a
> > file).  Having a choice seems the best route.
>
> What about an option (maybe even a default) to send the prompt to stdin?
>
> The Postgres command line interface psql appears to do this:
>
> $ psql 2>&1 >/dev/null
> Password:
> $
>
> (I typed my password and then I quit by typing ^D; if I type the wrong
> password, it looks the same on screen but it quits right away without
> waiting for ^D)
>
> I think ssh also does this when it needs to prompt for a password.
>
> Really the prompt is part of the input, not part of the output, in a
> certain sense.  Have people actually verified that the prompt is really
> sent to stderr right now by using 2>/dev/null to attempt to suppress it?
>
> Isaac Morland CSCF Web Guru
> DC 2554C, x36650  WWW Software Specialist
> ___
> 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/shiblon%40gmail.com
>

-- 
Sent from Gmail for mobile | mobile.google.com
___
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