Re: [Python-Dev] [Python-checkins] cpython (2.7): allow fake filenames in findsource (closes #9284)

2011-06-12 Thread Nick Coghlan
On Sun, Jun 12, 2011 at 6:56 AM, benjamin.peterson python-check...@python.org wrote: summary:  allow fake filenames in findsource (closes #9284) This allows findsource() to work in doctests. A patch from Dirkjan Ochtman. Either this exception should be mentioned in the inspect.getsource()

Re: [Python-Dev] [Python-checkins] cpython (2.7): allow fake filenames in findsource (closes #9284)

2011-06-12 Thread Benjamin Peterson
2011/6/12 Nick Coghlan ncogh...@gmail.com: On Sun, Jun 12, 2011 at 6:56 AM, benjamin.peterson python-check...@python.org wrote: summary:  allow fake filenames in findsource (closes #9284) This allows findsource() to work in doctests. A patch from Dirkjan Ochtman. Either this exception

Re: [Python-Dev] [Python-checkins] cpython (2.7): allow fake filenames in findsource (closes #9284)

2011-06-12 Thread Nick Coghlan
On Mon, Jun 13, 2011 at 1:31 AM, Benjamin Peterson benja...@python.org wrote: I should have made more clear in the message that this is actually a regression from 2.6. Actually looking at the inspect docs, I'm not sure where such a note would fit anyway. I'll think about it a bit more - I have

[Python-Dev] Implement Aspect-oriented programming

2011-06-12 Thread Jiawei Li
For example, the logging module is not very useful right now, as it requires sprinkling small one-liners all over my code - not exactly ideal. Why not take a page from aspect-oriented programming and allow for injection of code with point cuts? ___

[Python-Dev] Lazy unpacking for struct module

2011-06-12 Thread Lukas Lueg
Hi. We extensively use the struct module to crunch large amounts of binary data. There are basically two operations for us that only seem to the naked eye as one: Filtering (see if certain fields have certain values, throw everything away if not) and inspection (care about all the fields'

Re: [Python-Dev] Implement Aspect-oriented programming

2011-06-12 Thread Lennart Regebro
On Sat, Jun 11, 2011 at 10:29, Jiawei Li jiawei.h...@gmail.com wrote: For example, the logging module is not very useful right now, as it requires sprinkling small one-liners all over my code - not exactly ideal. Why not take a page from aspect-oriented programming and allow for injection of

Re: [Python-Dev] Implement Aspect-oriented programming

2011-06-12 Thread Oleg Broytman
Hi! This mailing list is to work on developing Python (discussing bugs and patches). There is python-ideas mailing list to discuss possible future improvements. Oleg. -- Oleg Broytmanhttp://phdru.name/p...@phdru.name Programmers don't die, they just GOSUB

Re: [Python-Dev] Python 3.x and bytes

2011-06-12 Thread Ethan Furman
Guido van Rossum wrote: On Thu, May 19, 2011 at 1:43 AM, Nick Coghlan wrote: Proposals to address this include: - introduce a character literal to allow c'a' as an alternative to ord('a') -1; the result is not a *character* but an integer. I'm personally favoring using b'a'[0] and possibly

Re: [Python-Dev] Lazy unpacking for struct module

2011-06-12 Thread Raymond Hettinger
On Jun 12, 2011, at 8:29 AM, Lukas Lueg wrote: Hi. We extensively use the struct module to crunch large amounts of binary data. There are basically two operations for us that only seem to the naked eye as one: Filtering (see if certain fields have certain values, throw everything away if

Re: [Python-Dev] Python 3.x and bytes

2011-06-12 Thread Martin v. Löwis
# constants EOH = b'\r'[0] CHAR = b'C'[0] DATE = b'D'[0] FLOAT = b'F'[0] INT = b'I'[0] LOGICAL = b'L'[0] MEMO = b'M'[0] NUMBER = b'N'[0] This is not beautiful code. In this case, I think the intent would be better captured with def ASCII(c): return c.encode('ascii') EOH =

Re: [Python-Dev] Python 3.x and bytes

2011-06-12 Thread Hagen Fürstenau
EOH = b'\r'[0] CHAR = b'C'[0] DATE = b'D'[0] FLOAT = b'F'[0] INT = b'I'[0] LOGICAL = b'L'[0] MEMO = b'M'[0] NUMBER = b'N'[0] This is not beautiful code. You still have the alternative EOH = ord('\r') CHAR = ord('C') ... which looks fine to me. Cheers, Hagen

[Python-Dev] [RELEASE] Python 2.7.2

2011-06-12 Thread Benjamin Peterson
On behalf of the Python development team, I'm rosy to announce the immediate availability of Python 2.7.2. Since the release candidate 2 weeks ago, there have been 2 changes: 1. pyexpat.__version__ has be changed to be the Python version. 2. A regression from 3.1.3 in the handling of comments in

[Python-Dev] [RELEASED] Python 3.1.4

2011-06-12 Thread Benjamin Peterson
On behalf of the Python development team, I'm sanguine to announce a release candidate for the fourth bugfix release for the Python 3.1 series, Python 3.1.4. Since the 3.1.4 release candidate 2 weeks ago, there have been three changes: 1. test_zipfile has been fixed on systems with an ASCII

Re: [Python-Dev] Lazy unpacking for struct module

2011-06-12 Thread Lukas Lueg
This is what people normally do (unpack just the values they need, when they need them). Due to the fact that there hundreds of format-strings which dynamically compiled from a more verbose language at runtime, we will have significant complexity in the code in order to generate format strings

Re: [Python-Dev] [RELEASE] Python 2.7.2

2011-06-12 Thread Terry Reedy
On 6/12/2011 1:57 PM, Benjamin Peterson wrote: To download Python 2.7.2 visit: http://www.python.org/download/releases/2.7.1/ That should be http://www.python.org/download/releases/2.7.2/ -- Terry Jan Reedy ___ Python-Dev mailing list

Re: [Python-Dev] [RELEASED] Python 3.1.4

2011-06-12 Thread Paul Moore
On 12 June 2011 18:58, Benjamin Peterson benja...@python.org wrote: On behalf of the Python development team, I'm sanguine to announce a release candidate for the fourth bugfix release for the Python 3.1 series, Python 3.1.4. Is this actually a RC, or is that a typo? Paul.

Re: [Python-Dev] [RELEASED] Python 3.1.4

2011-06-12 Thread Benjamin Peterson
2011/6/12 Paul Moore p.f.mo...@gmail.com: On 12 June 2011 18:58, Benjamin Peterson benja...@python.org wrote: On behalf of the Python development team, I'm sanguine to announce a release candidate for the fourth bugfix release for the Python 3.1 series, Python 3.1.4. Is this actually a RC,

Re: [Python-Dev] Lazy unpacking for struct module

2011-06-12 Thread Terry Reedy
On 6/12/2011 11:29 AM, Lukas Lueg wrote: This sort of speculative idea might fit the python-ideas list better. [Summary: we often need to extract a field or two from a binary record in order to decide whether to toss it or unpack it all and process.] One solution to this is using two

[Python-Dev] is anyone using Misc/RPM?

2011-06-12 Thread Benjamin Peterson
If no one is using it, I'd like to delete it. I also don't think we should be in business of distributing distribution specific files. -- Regards, Benjamin ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] is anyone using Misc/RPM?

2011-06-12 Thread Martin v. Löwis
Am 12.06.2011 22:37, schrieb Benjamin Peterson: I also don't think we should be in business of distributing distribution specific files. I disagree. We certainly include PCbuild/*.vcproj, and Tools/msi, which are also distribution-specific. Likewise, we have plenty of OSX-specific files

Re: [Python-Dev] is anyone using Misc/RPM?

2011-06-12 Thread Benjamin Peterson
2011/6/12 Martin v. Löwis mar...@v.loewis.de: Am 12.06.2011 22:37, schrieb Benjamin Peterson: I also don't think we should be in business of distributing distribution specific files. I disagree. We certainly include PCbuild/*.vcproj, and Tools/msi, which are also distribution-specific.

Re: [Python-Dev] Python 3.x and bytes

2011-06-12 Thread Greg Ewing
Guido van Rossum wrote: On Thu, May 19, 2011 at 1:43 AM, Nick Coghlan wrote: Proposals to address this include: - introduce a character literal to allow c'a' as an alternative to ord('a') -1; the result is not a *character* but an integer. Would you be happier if it were spelled i'a'

Re: [Python-Dev] Lazy unpacking for struct module

2011-06-12 Thread Greg Ewing
Raymond Hettinger wrote: The problem you're trying to solve isn't unique to structs. That's why we get periodic requests for ropes-like behaviors I don't think he's asking for rope-like behaviour here. Rather, he's asking for iterator-like or view-like behaviour -- for the same reasons we

Re: [Python-Dev] Lazy unpacking for struct module

2011-06-12 Thread Raymond Hettinger
On Jun 12, 2011, at 3:18 PM, Greg Ewing wrote: Raymond Hettinger wrote: The problem you're trying to solve isn't unique to structs. That's why we get periodic requests for ropes-like behaviors I don't think he's asking for rope-like behaviour here. How would you describe the creation of

Re: [Python-Dev] is anyone using Misc/RPM?

2011-06-12 Thread Stephen J. Turnbull
Benjamin Peterson writes: I should qualify: We shouldn't distribute distribution-specific files for which we don't provide binaries. Probably it belongs in a contrib area of the tree, but one of the things I find really annoying about distros is the way they refuse to use my perfectly good

Re: [Python-Dev] Python 3.x and bytes

2011-06-12 Thread Stephen J. Turnbull
Ethan Furman writes: Using this method, my code now looks like: # constants [...] This is not beautiful code. Put mascara on a pig, and you have a pig with mascara on, not Bette Davis. I don't necessarily think you're doing anybody a service by making the hack of using ASCII bytes as

Re: [Python-Dev] Python 3.x and bytes

2011-06-12 Thread Nick Coghlan
On Mon, Jun 13, 2011 at 3:18 AM, Ethan Furman et...@stoneleaf.us wrote: This is not beautiful code. Agreed, but: EOH, CHAR, DATE, FLOAT, INT, LOGICAL, MEMO, NUMBER = b'\rCDFILMN' is a shorter way to write the same thing. Going two per line makes it easier to mentally map the characters:

Re: [Python-Dev] Lazy unpacking for struct module

2011-06-12 Thread Nick Coghlan
On Mon, Jun 13, 2011 at 6:31 AM, Terry Reedy tjre...@udel.edu wrote: With just 1 or 2 filter fields, and very many other fields, I would just unpack everything, including the filter field. I expect the extra time to do that would be comparalbe to the extra time to combine. It certainly would