Re: [Python-Dev] Daemon process context as a ‘with ’ context manager

2009-03-17 Thread Ben Finney
Ben Finney ben+pyt...@benfinney.id.au writes: James Pye li...@jwp.name writes: with daemonized(): run_some_subprocess() This use case is addressed by my up-coming PEP, currently in draft form but submitted to the PEP editor. A reference implementation is at

[Python-Dev] py3k: accept unicode for 'c' and byte for 'C' in getarg?

2009-03-17 Thread Victor Stinner
Hi, I realised with the issue #3446 that getarg('c') (get a byte) accepts not only a byte string of 1 byte, but also an unicode string of 1 character (if the character code is in [0; 255]). I don't think that it's a good idea to accept unicode here. Example: bx.center(5, \xe9) should be a

Re: [Python-Dev] py3k: accept unicode for 'c' and byte for 'C' in getarg?

2009-03-17 Thread Victor Stinner
Le Tuesday 17 March 2009 13:52:16 Victor Stinner, vous avez écrit : I realised with the issue #3446 that getarg('c') (get a byte) accepts not only a byte string of 1 byte, but also an unicode string of 1 character (if the character code is in [0; 255]). I don't think that it's a good idea to

Re: [Python-Dev] What level of detail wanted for import and the language reference?

2009-03-17 Thread Nick Coghlan
Steve Holden wrote: Why not just put a section in both places that says can't be bothered to spell this out right now and put a URL in referring to this thread on Google ... that appears to have been the traditional approach to import semantics :) Well, first we point to Guido's original

Re: [Python-Dev] PEP 377 - allow __enter__() methods to skip the statement body

2009-03-17 Thread Nick Coghlan
Greg Ewing wrote: Um, no -- it says explicitly right at the very top of PEP 343 that it's only about factoring out try/finally statements. There's no way that try: code_block finally: ... can fail to enter the code block if you get as far as the try. So it's not

[Python-Dev] python-3000 is still mentioned on the mailing lists page

2009-03-17 Thread R. David Murray
I just noticed that the python-3000 list is still mentioned on http://www.python.org/community/lists/. I searched around a bit but it isn't obvious to me where other than here I should report this, so I'm reporting it here :). -- R. David Murray http://www.bitdance.com

Re: [Python-Dev] python-3000 is still mentioned on the mailing lists page

2009-03-17 Thread skip
David I just noticed that the python-3000 list is still mentioned on David http://www.python.org/community/lists/. Thanks. I passed your note along to the postmaster(s). Skip ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] py3k: accept unicode for 'c' and byte for 'C' in getarg?

2009-03-17 Thread Guido van Rossum
On Tue, Mar 17, 2009 at 5:52 AM, Victor Stinner victor.stin...@haypocalc.com wrote: I realised with the issue #3446 that getarg('c') (get a byte) accepts not only a byte string of 1 byte, but also an unicode string of 1 character (if the character code is in [0; 255]). I don't think that it's a

Re: [Python-Dev] What level of detail wanted for import and the language reference?

2009-03-17 Thread Brett Cannon
On Tue, Mar 17, 2009 at 06:55, Nick Coghlan ncogh...@gmail.com wrote: Steve Holden wrote: Why not just put a section in both places that says can't be bothered to spell this out right now and put a URL in referring to this thread on Google ... that appears to have been the traditional

Re: [Python-Dev] py3k: accept unicode for 'c' and byte for 'C' in getarg?

2009-03-17 Thread Victor Stinner
Le Tuesday 17 March 2009 17:27:39, vous avez écrit : The C format (get a character) has the opposite problem: it accepts both byte and unicode, whereas byte should be rejected. Example: mmap.write_byte('é') should be a TypeError. YEah, mmap should be defined exclusively in terms of bytes.

Re: [Python-Dev] py3k: accept unicode for 'c' and byte for 'C' in getarg?

2009-03-17 Thread Guido van Rossum
On Tue, Mar 17, 2009 at 10:03 AM, Victor Stinner victor.stin...@haypocalc.com wrote: Le Tuesday 17 March 2009 17:27:39, vous avez écrit : The C format (get a character) has the opposite problem: it accepts both byte and unicode, whereas byte should be rejected. Example: mmap.write_byte('é')

[Python-Dev] In-place operators

2009-03-17 Thread Raymond Hettinger
Does anyone think it was not a good idea to put in-place operations in the operator module? For some objects, they don't map() as well as their regular counterparts. Some in-place operations rely on the interpreter to take care of the actual assignment. I've not yet seen good use cases for

Re: [Python-Dev] In-place operators

2009-03-17 Thread Benjamin Peterson
2009/3/17 Raymond Hettinger pyt...@rcn.com: Does anyone think it was not a good idea to put in-place operations in the operator module?  For some objects, they don't map() as well as their regular counterparts.  Some in-place operations rely on the interpreter to take care of the actual

Re: [Python-Dev] In-place operators

2009-03-17 Thread Guido van Rossum
On Tue, Mar 17, 2009 at 2:54 PM, Benjamin Peterson benja...@python.org wrote: 2009/3/17 Raymond Hettinger pyt...@rcn.com: Does anyone think it was not a good idea to put in-place operations in the operator module?  For some objects, they don't map() as well as their regular counterparts.  Some

Re: [Python-Dev] In-place operators

2009-03-17 Thread Raymond Hettinger
Right. Since Python doesn't have a notation like operator + for turning operators into functions, the operator module provides this functionality. Better safe than sorry. It doesn't really expose this functionality because some of the functionality is buried in ceval.c and is not exposed by

Re: [Python-Dev] In-place operators

2009-03-17 Thread Antoine Pitrou
Raymond Hettinger python at rcn.com writes: I'm sure that consistency/completeness/safe_vs_sorry was the reason they were added. But, if they aren't useful, they never should have been (IMO). It wastes the time of people who try to use them and then find-out that they don't act as

Re: [Python-Dev] In-place operators

2009-03-17 Thread Martin v. Löwis
I'm sure that consistency/completeness/safe_vs_sorry was the reason they were added. But, if they aren't useful, they never should have been (IMO). Why is that? [you are then giving a reason:] It wastes the time of people who try to use them and then find-out that they don't act as

Re: [Python-Dev] In-place operators

2009-03-17 Thread Raymond Hettinger
Maybe someone somewhere has some interesting use for these in-place operator function. I hope so. It could be important if you want apply it to mutable objects, i.e. where the assignment doesn't do anything. I give up. My original question was whether anyone thought these were a good

Re: [Python-Dev] In-place operators

2009-03-17 Thread Martin v. Löwis
I give up. My original question was whether anyone thought these were a good idea. Look's like the answer is yes, Correct. everyone is happy with the functions and are glad they were added in 2.5. No. I don't really care - I don't use them, nor do I use anything else of the operator module

Re: [Python-Dev] In-place operators

2009-03-17 Thread Raymond Hettinger
[Martin v. Löwis] I would object to their removal, though, because it would hurt my sense of symmetry. I wasn't going to propose removal. If everyone had agreed that the operator in-place functions were problematic, I was going to suggest moving their docs to a second page and documenting

Re: [Python-Dev] In-place operators

2009-03-17 Thread Terry Reedy
Raymond Hettinger wrote: Does anyone think it was not a good idea to put in-place operations in the operator module? For some objects, they don't map() as well as their regular counterparts. Some in-place operations rely on the interpreter to take care of the actual assignment. I've not