Re: [Python-Dev] bytes / unicode

2010-06-20 Thread Lennart Regebro
g and escaping and such, and that could be done while the text is in bytes form.But the tools for that exists... Is there some specific tool that is missing? -- Lennart Regebro: http://regebro.wordpress.com/ Python 3 Porting: http://python3portin

Re: [Python-Dev] bytes / unicode

2010-06-21 Thread Lennart Regebro
2010/6/21 Stephen J. Turnbull : > IMO, the UI is right.  "Something" like the above "ought" to work. Right. That said, many times when you want to do urlparse etc they might be binary, and you might want binary. So maybe the methods should work with both? --

Re: [Python-Dev] #Python3 ! ? (was Python Library Support in 3.x)

2010-06-21 Thread Lennart Regebro
27;t > use Python 3… yet". Well, it *should* say: "If you need to ask if you should use Python 2 or Python 3, you probably are better off with Python 2 for the moment". But that's a bit long. :-) -- Lennart Regebro: http://regebro.wordpress.com/ Python 3 Porting: h

Re: [Python-Dev] #Python3 ! ? (was Python Library Support in 3.x)

2010-06-21 Thread Lennart Regebro
On Sun, Jun 20, 2010 at 18:20, Laurens Van Houtven wrote: > 2.x or 3.x? http://tinyurl.com/py2or3 Wow. That's almost not an improvement... That link doesn't really help anyone choose at all. -- Lennart Regebro: Python, Zope, Plone, Grok http://regebro.wordpress.com/ +33

Re: [Python-Dev] #Python3 ! ? (was Python Library Support in 3.x)

2010-06-21 Thread Lennart Regebro
On Mon, Jun 21, 2010 at 23:26, Simon de Vlieger wrote: > That part of the topic will be replaced after all feedback is gathered on > the new article Laurens provided at: > http://python-commandments.org/python3.html as stated earlier in this > thread. OK, great, I missed that!

Re: [Python-Dev] bytes / unicode

2010-06-24 Thread Lennart Regebro
ction, it's just a missing feature in the stdlib. -- Lennart Regebro: http://regebro.wordpress.com/ Python 3 Porting: http://python3porting.com/ +33 661 58 14 64 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/

Re: [Python-Dev] Add aware local time support to datetime module

2010-08-08 Thread Lennart Regebro
olution is pytz. :-) What pytz doesn't have (but dateutil.tz does) is a timezone object that uses the operating systems local timezone data, like /etc/localzone on unix. That could be interesting to include, possibly. Having a fixed time zone offset object for the localtime seems a bad idea. The p

Re: [Python-Dev] Continuing 2.x

2010-11-08 Thread Lennart Regebro
a moratorium anyway. Improvements in the standard library can be more easily done in external libraries anyway, and then you can release the improved libraries for everything from Python 2.4 and forwards if you like. So it can be done, but the question is "Why?" -- Lennart Regebro, Collib

Re: [Python-Dev] new buffer in python2.7

2010-11-08 Thread Lennart Regebro
alue): if isinstance(value, str): # It's a unicode string: value = value.encode('ISO-8859-1') return super(Bites, cls).__new__(cls, value) def itemint(self, x): return self[x] def iterint(self)

Re: [Python-Dev] Continuing 2.x

2010-11-08 Thread Lennart Regebro
2010/11/8 James Y Knight : > On Nov 8, 2010, at 4:42 AM, Lennart Regebro wrote: >> Except for making releases that start backporting Python 3 features >> and breaking backwards compatibility gradually (which may or may not >> be a good idea) I don't see the point. Ther

Re: [Python-Dev] Python and the Unicode Character Database

2010-11-30 Thread Lennart Regebro
> audit_log("Deposited: " + amountstr) > > Auditor: > > $ cat numbered-account.log > Deposited: ?.?? That log reasonably should be in UTF-8 or something else, in which case this is not a problem. And that's ignoring that it makes way more sense to log the nu

Re: [Python-Dev] Python and the Unicode Character Database

2010-12-01 Thread Lennart Regebro
On Tue, Nov 30, 2010 at 09:23, Stephen J. Turnbull wrote: > Sure you can.  In Python program text, all keywords will be ASCII Yes, yes, sure, but not the contents of variables, > I see no reason not to make a similar promise for numeric literals. Wait what, literas? The example was >>> float('

Re: [Python-Dev] Python and the Unicode Character Database

2010-12-02 Thread Lennart Regebro
2010/12/2 Stephen J. Turnbull : > Because that works, but > > print(T1234) > > doesn't (it prints ASCII).  You can't round-trip, but users will > want/expect that. You should be able to round-trip, absolutely. I don't think you should expect print() to do that. str(56) possibly. :) That's an argum

Re: [Python-Dev] Porting Ideas

2010-12-02 Thread Lennart Regebro
On Wed, Dec 1, 2010 at 20:17, Antoine Pitrou wrote: > And I'm not sure what this package called "Python" is (“a high-level > object-oriented programming language”? like Java?), but I'm pretty sure > I've heard there's a Python 3 compatible version. Uhm... http://pypi.python.org/pypi/Python Anybo

Re: [Python-Dev] 3.2.0

2011-02-17 Thread Lennart Regebro
On Thu, Feb 17, 2011 at 12:20, Antoine Pitrou wrote: > Agreed. Although better to defer it to 3.3.0 at this point. +1.0.0 for that. Yes, it's confusing, but it's going to be even more confusing if it's called 3.2 sometimes and 3.2.0 sometimes. -- Lennart Regebro: http://reg

Re: [Python-Dev] public visibility of python-dev decisions "before it's too late" (was: PyCObject_AsVoidPtr removed from python 3.2 - is this documented?)

2011-03-14 Thread Lennart Regebro
making 3.2 a moot and unsupported version. It can possibly be removed in 3.3, but better would be 3.4. It must be possible to support 3-4 releases of Python with the current release speed. We need to support python versions that are five years old or so. In fact the deprecation period should probab

Re: [Python-Dev] public visibility of python-dev decisions "before it's too late"

2011-03-15 Thread Lennart Regebro
On Tue, Mar 15, 2011 at 09:20, "Martin v. Löwis" wrote: >> In fact, since the deprecation in the Python 2 line happened in 2.7, >> the deprecation period of this API in practice was between July 3rd >> 2010 and February 20 2011. That is a deprecation period of somewhat >> longer than seven months.

Re: [Python-Dev] public visibility of python-dev decisions "before it's too late" (was: PyCObject_AsVoidPtr removed from python 3.2 - is this documented?)

2011-03-15 Thread Lennart Regebro
On Mon, Mar 14, 2011 at 19:22, Reid Kleckner wrote: > I don't know how your code works, but handling either type from C > seems very straightforward to me.  You can simply use #ifdef > Py_COBJECT_H to see if the cobject.h header was pulled into Python.h. > Similarly for Py_CAPSULE_H.  All you lose

Re: [Python-Dev] public visibility of python-dev decisions "before it's too late"

2011-03-15 Thread Lennart Regebro
On Tue, Mar 15, 2011 at 12:02, "Martin v. Löwis" wrote: > If you actually had been supporting 2.x and 3.x in parallel for the last two > years, you would have had a deprecation period of 19 months > and two releases. It's only if you are now migrating from 2 to 3 > that you notice the breakage for

Re: [Python-Dev] public visibility of python-dev decisions "before it's too late"

2011-03-15 Thread Lennart Regebro
On Tue, Mar 15, 2011 at 15:39, "Martin v. Löwis" wrote: > Of course you could have. You could have added a version of your code > that uses capsules (just as you are probably doing now). No I'm not. > Right - and that's why the deprecation period is not about supporting > multiple versions, but

Re: [Python-Dev] public visibility of python-dev decisions "before it's too late"

2011-03-15 Thread Lennart Regebro
On Tue, Mar 15, 2011 at 18:56, Nick Coghlan wrote: > why not just consider this another > instance of the 2.x/3.x incompatibility? That's what it is after all. Apparently not, as the code already ran under Python 3.1. //Lennart ___ Python-Dev mailing l

Re: [Python-Dev] public visibility of python-dev decisions "before it's too late"

2011-03-15 Thread Lennart Regebro
On Tue, Mar 15, 2011 at 19:14, Antoine Pitrou wrote: > Beside, if you need long-term support, there is a well-known solution: > turn to a company that provides such support. That company can be called > Redhat, Canonical, ActiveState or even Apple. The community of > volunteers called python-dev i

Re: [Python-Dev] public visibility of python-dev decisions "before it's too late"

2011-03-15 Thread Lennart Regebro
On Tue, Mar 15, 2011 at 21:54, Antoine Pitrou wrote: > I don't know what other core devs, but I don't think this discussion is > going anywhere. If porting the ZTK is a burden for you, perhaps you > should try to find some financial support for it (or let other people > do it for you), rather than

Re: [Python-Dev] public visibility of python-dev decisions "before it's too late"

2011-03-15 Thread Lennart Regebro
On Tue, Mar 15, 2011 at 22:42, Guido van Rossum wrote: > Fortunately there may not be any more such cases since no new major > versions of Python 2 will be released. So I'm not sure what an update > of PEP 5 will buy us. That is a good point. But at least making sure no more API's get deprecated

Re: [Python-Dev] public visibility of python-dev decisions "before it's too late"

2011-03-15 Thread Lennart Regebro
On Tue, Mar 15, 2011 at 22:58, Lennart Regebro wrote: > That is a good point. But at least making sure no more API's get > deprecated in 3.3 (and preferably 3.4) I meant removed. ___ Python-Dev mailing list Python-Dev@python.org http://mail

Re: [Python-Dev] API deprecations in Python 3, from a Python 2 perspective

2011-03-18 Thread Lennart Regebro
On Fri, Mar 18, 2011 at 00:23, Terry Reedy wrote: > People should retest their stuff with each micro > (bugfix) release anyway. That would be creating an insane burden on library developers. Besides, I've so far not have things break between micro releases, it must be very unusual. That said, wh

Re: [Python-Dev] API deprecations in Python 3, from a Python 2 perspective

2011-03-19 Thread Lennart Regebro
On Sat, Mar 19, 2011 at 03:42, Nick Coghlan wrote: > 5. The parallel evolution of the 2.x and 3.x line meant that the first > version of 2.x with the relevant warning was released only ~7 months > or so before the version of 3.2 where the API was removed An additional issue that makes it particul

Re: [Python-Dev] Python3: speed efficiency vs user friendliness (my first experience)

2011-03-23 Thread Lennart Regebro
On Tue, Mar 22, 2011 at 22:12, Steven D'Aprano wrote: > The main one that comes to my mind is that other than looping, any time I > want to process dict.items() etc I often need to call list() first. "Process" no. If you want it to be a list, yes. This is because they now return generators, which

Re: [Python-Dev] Python3: speed efficiency vs user friendliness (my first experience)

2011-03-23 Thread Lennart Regebro
On Wed, Mar 23, 2011 at 13:01, Steven D'Aprano wrote: > But the improvement is exactly what Anatoly is talking about: it's an > improvement in speed over user convenience. If all you are doing is > iterating over a moderately-sized dictionary, you probably don't care > whether items() etc. returns

Re: [Python-Dev] Security implications of pep 383

2011-03-29 Thread Lennart Regebro
On Tue, Mar 29, 2011 at 22:40, Lennart Regebro wrote: > The lesson here seems to be "if you have to use blacklists, and you > use unicode strings for those blacklists, also make sure the string > you compare with doesn't have surrogates". > For that matter, what happen

Re: [Python-Dev] Security implications of pep 383

2011-03-29 Thread Lennart Regebro
The lesson here seems to be "if you have to use blacklists, and you use unicode strings for those blacklists, also make sure the string you compare with doesn't have surrogates". //Lennart ___ Python-Dev mailing list Python-Dev@python.org http://mail.pyt

Re: [Python-Dev] Security implications of pep 383

2011-03-29 Thread Lennart Regebro
On Wed, Mar 30, 2011 at 07:54, Toshio Kuratomi wrote: > Lennart is missing that you just need to use the same encoding > + surrogateescape (or stick with bytes) for decoding the byte strings that > you are comparing. You lost me here. I need to do this for what? //Lennart ___

Re: [Python-Dev] Security implications of pep 383

2011-03-29 Thread Lennart Regebro
On Tue, Mar 29, 2011 at 23:17, "Martin v. Löwis" wrote: > I think the whole blacklist example is artificial. The string in the > blacklist is actually a Chinese "hello" greeting, so it surely isn't > the string being blacklisted. For proper blacklisting, you would likely > use substring searches,

Re: [Python-Dev] Bug? Can't rebind local variables after calling pdb.set_trace()

2011-04-12 Thread Lennart Regebro
Hasn't it always been like that? I tried with Python 2.3 now and it's the same. I have no memory of that actually changing an existing variable in any version of Python I've used. More testing turns out that this works: -> print "lv is ", lv (Pdb) lv=2 (Pdb) c lv is 2 While this seem to "reset"

Re: [Python-Dev] Drop OS/2 and VMS support?

2011-04-20 Thread Lennart Regebro
gt; simply? I say "all of the above". It could be good to find a OS/2 and OpenVMS developer mailing list as well, and post it there. -- Lennart Regebro, Colliberty: http://www.colliberty.com/ Telephone: +48 691 268 328 ___ Python-Dev

Re: [Python-Dev] Why doesn't `functools.total_ordering` use the existing ordering methods?

2011-04-26 Thread Lennart Regebro
ggested? This has been partly fixed for Python 3.2, although it can still happen if you compare two types that both use the total_ordering decorator. See http://bugs.python.org/issue10042 . -- Lennart Regebro: http://regebro.wordpress.com/ Porting to

Re: [Python-Dev] [Python-checkins] peps: Add rules for indenting continuation lines.

2011-06-03 Thread Lennart Regebro
On Fri, Jun 3, 2011 at 00:15, Barry Warsaw wrote: > On Jun 02, 2011, at 12:57 PM, Glenn Linderman wrote: > >>On 6/2/2011 12:01 PM, Guido van Rossum wrote: >>> Bingo. That's why. (Though you are missing some colons in your examples.:-) >>> >>> --Guido >> >>You operate as a good Python compiler :) >

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

2011-06-12 Thread Lennart Regebro
e with point cuts? I'm not sure why you would say this isn't allowed already... -- Lennart Regebro: http://regebro.wordpress.com/ Porting to Python 3: http://python3porting.com/ ___ Python-Dev mailing list Python-Dev@python.org http://mail.pytho

[Python-Dev] Proposal: from __future__ import unicode_string_literals

2008-03-23 Thread Lennart Regebro
> Could we point them to a special byte-code compiler such as Andrew > Dalke's python4ply: ??? I'm not sure what this means... :) -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 ___ Python-Dev ma

Re: [Python-Dev] Proposal: from __future__ import unicode_string_literals

2008-03-23 Thread Lennart Regebro
xperience in writing code for evolving APIs, this is how things have been done in the Zope community for years. It's not a problem. It does not lead to fragile code. -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 ___

Re: [Python-Dev] Proposal: from __future__ import unicode_string_literals

2008-03-23 Thread Lennart Regebro
The community doesn't have the resources to maintain momentum in a language if the energy is divided in half. -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 ___ Python-Dev mailing list Python-Dev@python.

Re: [Python-Dev] Proposal: from __future__ import unicode_string_literals

2008-03-24 Thread Lennart Regebro
I am talking about looks. > > Can you give me examples of such software? I'll repeat the link where I explained my point on this: http://regebro.wordpress.com/2008/03/22/why-python-26-and-30-compatibility-would-be-a-very-good-thing/ -- Lennart Regebro: Zope and Plone consulting

Re: [Python-Dev] Proposal: from __future__ import unicode_string_literals

2008-03-24 Thread Lennart Regebro
f module are the same people will have big difficulties with the 2to3 approach and would be the people who are most likely to not be able to in practice go forward to Python 3 unless they have some sort of smooth path forward. -- Lennart Regebro: Zope and Plone consulting. h

Re: [Python-Dev] Proposal: from __future__ import unicode_string_literals

2008-03-24 Thread Lennart Regebro
ped in that kind of environment, and I'm sorry I'm not able to make this clearer. But that's just the way it is. -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 ___ Python-Dev mailing list Python

Re: [Python-Dev] Proposal: from __future__ import unicode_string_literals

2008-03-24 Thread Lennart Regebro
to test the code in both environments, so I don't see how that is a difference. -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailma

Re: [Python-Dev] Proposal: from __future__ import unicode_string_literals

2008-03-24 Thread Lennart Regebro
t;The Plone collective" is not > a specific example It is a specific example. -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailm

Re: [Python-Dev] Proposal: from __future__ import unicode_string_literals

2008-03-24 Thread Lennart Regebro
On Mon, Mar 24, 2008 at 1:03 PM, Paul Moore <[EMAIL PROTECTED]> wrote: > On 24/03/2008, Lennart Regebro <[EMAIL PROTECTED]> wrote: > > On Mon, Mar 24, 2008 at 11:29 AM, Thomas Wouters <[EMAIL PROTECTED]> wrote: > > > safe assumption to make. A simple preproce

Re: [Python-Dev] Proposal: from __future__ import unicode_string_literals

2008-03-24 Thread Lennart Regebro
her desirable, or > your current practice). I think maybe you missed the statement I responded to, claiming that 2to3 would require no knowledge about the differences between Python 2.6 and 3.0, implying that you could just run it, and it would always work, which I don't believe. --

Re: [Python-Dev] Proposal: from __future__ import unicode_string_literals

2008-03-24 Thread Lennart Regebro
p process, it is impossible to identify if there > is any point in the procedure where an invocation of 2to3 could be > inserted relatively painlessly. It can't. That's the whole point. -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 __

Re: [Python-Dev] Proposal: from __future__ import unicode_string_literals

2008-03-24 Thread Lennart Regebro
still think the forwards compatibility that exists in 2.6 is a good idea, and the more of it the better. -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 ___ Python-Dev mailing list Python-Dev@python.org http://mail.pyt

Re: [Python-Dev] Proposal: from __future__ import unicode_string_literals

2008-03-25 Thread Lennart Regebro
amples. No I don't. Here is what I said: "In many other cases, this is not how code is developed. Both within larger organisations and within large communities like Zope and Plone". I don't think chewing through this issue once more is meaningful, so I'll stop now. --

Re: [Python-Dev] how to easily consume just the parts of eggs that are good for you

2008-03-26 Thread Lennart Regebro
Has somebody made a list of the problems with eggs? Because I use them all the time and hasn't encountered any problems whatsoever, myself... :) So I am a bit surprised at the various discussions about them. ___ Python-Dev mailing list Python-Dev@python.o

Re: [Python-Dev] Conditional For Statements

2008-05-19 Thread Lennart Regebro
t; > | and > | > | for {variable} in filter(lambda: {condition}, iterable): > |{block} > > IDLE 3.0a5 >>>> for i in filter(lambda i: i%2, range(10)): > print(i) > > > 1 > 3 > 5 > 7 > 9 How was it again? "One and only one way"? :-

Re: [Python-Dev] Module renaming and pickle mechanisms

2008-05-19 Thread Lennart Regebro
cially if the old names are still available after the future import, as all that would then be needed it to repickle all the pickles to convert from 2.5 to 3.0 pickles, right? So, if I understood this correctly, that sounds like a perfect solution. :) -- Lennart Regebro: Zope and Plone consulting. http

Re: [Python-Dev] Proposal: new environment variable PYTHONSTDOUTENCODING

2008-05-20 Thread Lennart Regebro
en 'print' writes to > sys.stdout. Isn't it then enough to make sure your locale setting are correct? (Never had any problems myself, if works great in Ubuntu). -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64

Re: [Python-Dev] Any PEP about 2.6 -> 3000 code transition?

2008-06-02 Thread Lennart Regebro
add that (or any other tests) that would be very appreciated! -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] Any PEP about 2.6 -> 3000 code transition?

2008-07-21 Thread Lennart Regebro
e examples of the C-api changes as well. That would really help in migrating and writing a migration guide. It would be great if you could help with this! -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 ___ Python-

Re: [Python-Dev] Any PEP about 2.6 -> 3000 code transition?

2008-07-21 Thread Lennart Regebro
h, these changes should be properly documented in the CHANGES.txt. I've seen some C-API chnges mentiones at least. -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 ___ Python-Dev mailing list Python-Dev@pyt

Re: [Python-Dev] Syntax error in python2.6

2008-07-21 Thread Lennart Regebro
de Zope itself is using this call, which is hard to say. Options here are 1. Deprecating the "with" parameter for "with_" and supporting both in 2.12 but not supporting Python2.6. 2. Using **kw in the argument and looking for noth "with" and "with_", that way,

Re: [Python-Dev] [Zope-dev] import error in python2.6

2008-07-21 Thread Lennart Regebro
ror under 2.6 that is not a syntaxerror under 2.5, so the import fails, or the C-modules that it uses fail it's compile during setup, so import of them failed. -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64

Re: [Python-Dev] Any PEP about 2.6 -> 3000 code transition?

2008-07-21 Thread Lennart Regebro
t now, and I agree that it would be great if this would start now. But writing a guide might not be a good idea until we know what the changes are, and if the API is changing quickly now we don't. :-) -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/

Re: [Python-Dev] Any PEP about 2.6 -> 3000 code transition?

2008-07-26 Thread Lennart Regebro
I've added a setup.py to the python-incompatibilities projects code, so adding c-extention modules should now be much easier. I don't do much c-development myself, so I'm not the right person to do this, but anybody that feels like adding C-extensions to this project is more than welcome to do so.

Re: [Python-Dev] Infix operators

2008-07-27 Thread Lennart Regebro
nt goes away since you can't use the proper symbols anyway, and ambiguity is reintroduced. It seems to me that mathematicians who need these things would be better served by dedicated maths-software. Just my 2 cents. -- Lennart Regebro: Zope and Plone consulting. http://www.colli

Re: [Python-Dev] for __future__ import planning

2008-10-12 Thread Lennart Regebro
or str) a possibility? It may be that this isn't a problem in practice, I don't know yet. :) -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 ___ Python-Dev mailing list Python-Dev@python.org http://ma

Re: [Python-Dev] datetime.date.today() raises "AttributeError: time"

2008-12-10 Thread Lennart Regebro
seven years of heavy Python programming. >> >> - Tal >> ___ >> Python-Dev mailing list >> Python-Dev@python.org >> http://mail.python.org/mailman/listinfo/python-dev >> Unsubscribe: >> http://mail.python.org/ma

Re: [Python-Dev] datetime.date.today() raises "AttributeError: time"

2008-12-10 Thread Lennart Regebro
On Wed, Dec 10, 2008 at 18:49, James Y Knight <[EMAIL PROTECTED]> wrote: > > On Dec 10, 2008, at 5:55 AM, Lennart Regebro wrote: > >> Turns out, I created an empty time.py in /tmp, just to see the error >> message. By buildout will when creating eggs from checked out

Re: [Python-Dev] The endless GIL debate: why not remove thread support instead?

2008-12-12 Thread Lennart Regebro
t's uses, just not the one *you* want. -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: htt

[Python-Dev] 2to3 question about fix_imports.

2008-12-12 Thread Lennart Regebro
The fix_imports fix seems to fix only the first import per line that you have. So if you do for example import urllib2, cStringIO it will not fix cStringIO. Is this a bug or a feature? :-) If it's a feature it should warn at least, right? -- Lennart Regebro: Zope and Plone consulting.

Re: [Python-Dev] The endless GIL debate: why not remove thread support instead?

2008-12-12 Thread Lennart Regebro
ing removal of threads but rather the Java threading model. > I just think it is a mistake to let multiple OS threads touch the same > interpreter. Does Python have a java threading model? I don't know java well enough to know what that is. :) -- Lennart Regebro: Zope and Plone consulting.

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread Lennart Regebro
replacing it seems to be a better idea at first glance, but what if you then end up with two filenames that are the same? Possibly replacing with the character is a good idea to notify that the file is there, but fail then fail to open it. -- Lennart Regebro: Zope and Plone consult

Re: [Python-Dev] 2to3 question about fix_imports.

2008-12-14 Thread Lennart Regebro
On Sun, Dec 14, 2008 at 19:19, Alexandre Vassalotti wrote: > Which revision of python are you using? I tried the test-case you gave > and 2to3 translated it perfectly. 3.0, I haven't tried with trunk yet, and possibly it's a more complicated usecase. -- Lennart Regebro

Re: [Python-Dev] 2to3 question about fix_imports.

2008-12-14 Thread Lennart Regebro
e open a bug on bugs.python.org > and set me as the assignee (my user id is alexandre.vassalotti). Actually, it wasn't more complex, but it was completely different. It doesn't have anything with the amount of statements, but it's specifically if you have urlparse in the imports tha

Re: [Python-Dev] 2to3 question about fix_imports.

2008-12-14 Thread Lennart Regebro
On Sun, Dec 14, 2008 at 20:02, Lennart Regebro wrote: > On Sun, Dec 14, 2008 at 19:49, Alexandre Vassalotti > wrote: >>> 3.0, I haven't tried with trunk yet, and possibly it's a more >>> complicated usecase. >> >> Strange, fix_imports in Python 3.0

Re: [Python-Dev] Python 3.0.1

2009-01-31 Thread Lennart Regebro
Just my 2 eurocents: I think version numbers communicate a couple of things. One thing the communicate is that if you go from x.y.0 to x.y.1 (or from x.y.34 to x.y.35 for that matter) you signify that this is a bug fix release, and that the risk of any of your stuff breaking is close to zero, unle

Re: [Python-Dev] Status of the built-in virtualenv functionality in 3.3

2011-10-06 Thread Lennart Regebro
+1 for env or sandbox or something else with "box" in it. pythonbox? envbox? boxenv? ___ 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/arch

Re: [Python-Dev] PEP 405 (proposed): Python 2.8 Release Schedule

2011-11-15 Thread Lennart Regebro
On Wed, Nov 9, 2011 at 17:18, Amaury Forgeot d'Arc wrote: > Hi, > 2011/11/9 Barry Warsaw >> >> I think we should have an official pronouncement about Python 2.8, and >> PEPs >> are as official as it gets 'round here. > > Do we need to designate a release manager? I volunteer. It's on my level of

Re: [Python-Dev] readd u'' literal support in 3.3?

2011-12-08 Thread Lennart Regebro
"from future import unicode_literals" is my fault. I'm sorry. It's pretty useless. It was suggested by somebody and I then supported it's adding, instead of allowing u'' which I suggested. But it doesn't work. One reason is that you need to be able to say "This should be str in Python 2, and binar

Re: [Python-Dev] readd u'' literal support in 3.3?

2011-12-09 Thread Lennart Regebro
On Fri, Dec 9, 2011 at 03:53, Guido van Rossum wrote: > Are you saying that with that future import, b"..." is still a Unicode > literal? If I said that, this is not what I was trying to say. :-) //Lennart ___ Python-Dev mailing list Python-Dev@python.

Re: [Python-Dev] readd u'' literal support in 3.3?

2011-12-09 Thread Lennart Regebro
On Fri, Dec 9, 2011 at 04:34, Barry Warsaw wrote: > Sorry, I don't understand this.  What does it mean to be "str in both > versions"?  And why would you want that? It means that it's a str, that is a string of bytes, in Python 2, and a str, that is a string of Unicode characters, in Python 3. Th

Re: [Python-Dev] readd u'' literal support in 3.3?

2011-12-09 Thread Lennart Regebro
Slightly OT: The slowness of running 2to3 during install time can be fixed by not doing so, but instead running it when the distribution is created, including both Python 2 and Python 3 code in the distribution. http://python3porting.com/2to3.html#distribution-section There are no tools that sup

Re: [Python-Dev] readd u'' literal support in 3.3?

2011-12-09 Thread Lennart Regebro
On Fri, Dec 9, 2011 at 17:38, Éric Araujo wrote: > When running 2to3 from a setup.py script, does it run on the whole > codebase or only files that are found newer by the make-like > timestamp-based dependency system? Only on the ones that are newer. But since at install time, that's all of them,

Re: [Python-Dev] [PATCH] Adding braces to __future__

2011-12-10 Thread Lennart Regebro
On Sat, Dec 10, 2011 at 13:15, Ben Finney wrote: > Guido van Rossum writes: > >> On Fri, Dec 9, 2011 at 12:26 PM, Cedric Sodhi wrote: >> >> > IF YOU THINK YOU MUST REPLY SOMETHING WITTY, ITERATE THAT THIS HAD >> > BEEN DISCUSSED BEFORE, REPLY THAT "IT'S SIMPLY NOT GO'NNA HAPPEN", >> > THAT "WHO

Re: [Python-Dev] readd u'' literal support in 3.3?

2011-12-13 Thread Lennart Regebro
On Tue, Dec 13, 2011 at 14:33, Laurence Rowe wrote: > Could this manual work be cut down if there was a version of 2to3 that > targeted the subset of the language that is compatible with both 2 and 3? Not really, but a 2to6, ie something that tries to keep Python 2 compatibility by using the six

Re: [Python-Dev] readd u'' literal support in 3.3?

2011-12-13 Thread Lennart Regebro
On Tue, Dec 13, 2011 at 23:38, Nick Coghlan wrote: > On Wed, Dec 14, 2011 at 8:17 AM, Michael Foord > wrote: >> More specifically "six" [1] is the name of Benjamin Peterson's support >> package to help write code that works on both 2 and 3. So the idea is that >> the conversion isn't just a strai

Re: [Python-Dev] readd u'' literal support in 3.3?

2011-12-14 Thread Lennart Regebro
On Wed, Dec 14, 2011 at 17:33, Tres Seaver wrote: > Not in the experience of the folks who are actually doing that task:  the > overhead of running 2to3 every time 'setup.py develop' etc. runs dooms > the effort.  For instance, we have a report that the 2to3 step takes more > than half an hour (on

Re: [Python-Dev] Status of the fix for the hash collision vulnerability

2012-01-13 Thread Lennart Regebro
On Fri, Jan 13, 2012 at 02:24, Victor Stinner wrote: > - Glenn Linderman proposes to fix the vulnerability by adding a new > "safe" dict type (only accepting string keys). His proof-of-concept > (SafeDict.py) uses a secret of 64 random bits and uses it to compute > the hash of a key. This is my p

Re: [Python-Dev] Counting collisions for the win

2012-01-20 Thread Lennart Regebro
On Fri, Jan 20, 2012 at 01:48, Victor Stinner wrote: >  - the limit should be configurable: a new function in the sys module > should be enough. It may be private (or replaced by an environment > variable?) in stable versions I'd like to see both. I would like both the programmer and the "user" t

Re: [Python-Dev] Counting collisions for the win

2012-01-22 Thread Lennart Regebro
On Sun, Jan 22, 2012 at 11:11, Victor Stinner wrote: >> This seed is chosen randomly at runtime, but cannot >> change once chosen. > > The hash is used to compare objects: if hash(obj1) != hash(obj2), > objects are considered different. So two strings must have the same > hash if their value is th

Re: [Python-Dev] Counting collisions for the win

2012-01-22 Thread Lennart Regebro
On Mon, Jan 23, 2012 at 06:02, Paul McMillan wrote: >> We may use a different salt per dictionary. > > If we're willing to re-hash everything on a per-dictionary basis. That > doesn't seem reasonable given our existing usage. Well, if we get crazy amounts of collisions, re-hashing with a new salt

Re: [Python-Dev] Python 3 optimizations, continued, continued again...

2012-02-02 Thread Lennart Regebro
On Wed, Feb 1, 2012 at 20:08, stefan brunthaler wrote: > I understand all of these issues. Currently, it's not really a mess, > but much more complicated as it needs to be for only supporting the > inca optimization. I really don't think that is a problem. The core contributors can deal well with

Re: [Python-Dev] PEP 414 - Unicode Literals for Python 3

2012-02-27 Thread Lennart Regebro
#x27;' prefix is the easiest, most obvious/intuitive/pythong/whatever way of getting that support, that requires the least amount of code change, and the least ugly code. -- Lennart Regebro: http://regebro.wordpress.com/ Porting to Python 3:

Re: [Python-Dev] PEP 414 - Unicode Literals for Python 3

2012-02-28 Thread Lennart Regebro
On Tue, Feb 28, 2012 at 08:51, Vinay Sajip wrote: > Lennart Regebro gmail.com> writes: > >> I'm +1 on the PEP, for reasons already repeated here. >> We need three types of strings when supporting both Python 2 and >> Python 3. A binary string, a unicode string

Re: [Python-Dev] PEP 414 - Unicode Literals for Python 3

2012-02-28 Thread Lennart Regebro
On Tue, Feb 28, 2012 at 13:10, Vinay Sajip wrote: > We might be at cross purposes here. I don't see how Distribute helps, because > the use case I'm talking about is not about distributing or installing stuff, > but iteratively changing and testing code which needs to work on 2.6+, 3.2 and > 3.3+.

Re: [Python-Dev] PEP 414 - Unicode Literals for Python 3

2012-02-28 Thread Lennart Regebro
All the various strategies for supporting Python 2 and Python 3 as well as their various drawbacks and ways around this is covered in my book, chapter 2. :-) http://python3porting.com/strategies.html I may be too late to point this out, but it feels like this discussion could have been shorter if

Re: [Python-Dev] PEP 414 - Unicode Literals for Python 3

2012-02-28 Thread Lennart Regebro
On Tue, Feb 28, 2012 at 16:30, Giampaolo Rodolà wrote: > Il 28 febbraio 2012 15:20, Ezio Melotti ha scritto: >> (Note: there are also other costs -- e.g. releasing -- that I haven't >> considered because they don't affect me personally, but I'm not sure they >> are big enough to make the two-bran

Re: [Python-Dev] PEP 414 - Unicode Literals for Python 3

2012-02-28 Thread Lennart Regebro
On Tue, Feb 28, 2012 at 16:39, Vinay Sajip wrote: > Serhiy Storchaka gmail.com> writes: > >> Another pertinent question: "What are disadvantages of PEP 414 is adopted?" > > It's moot, but as I see it: the purpose of PEP 414 is to facilitate a single > codebase across 2.x and 3.x. The bytes/nativ

Re: [Python-Dev] Backporting PEP 414

2012-02-28 Thread Lennart Regebro
On Tue, Feb 28, 2012 at 21:27, Ethan Furman wrote: > Here's what I know: > > We don't add features to bug-fix releases. > u'' is considered a feature. > By not backporting to 3.1 and 3.2 we are not easing the migration pains from > 2.x. If this is added to 3.2.3, then some programs will work with

Re: [Python-Dev] Spreading the Python 3 religion

2012-03-01 Thread Lennart Regebro
I also don't agree with the claim that a py3 version using 2to3 is a "second class citizen". You need to adopt the Python 2 code to Python 3 in that case too, and none of the overrules the other. //Lennart ___ Python-Dev mailing list Python-Dev@python.or

Re: [Python-Dev] PEP 414

2012-03-02 Thread Lennart Regebro
Just my 2 cents on the PEP rewrite: u'' support is not just if you want to write code that doesn't use 2to3. Even when you use 2to3 it is useful to be able to flag strings s binary, unicode or "native". //Lennart ___ Python-Dev mailing list Python-Dev@p

Re: [Python-Dev] PEP 414

2012-03-02 Thread Lennart Regebro
On Fri, Mar 2, 2012 at 15:26, Serhiy Storchaka wrote: > 02.03.12 15:49, Lennart Regebro написав(ла): > >> Just my 2 cents on the PEP rewrite: >> >> u'' support is not just if you want to write code that doesn't use >> 2to3. Even when you use 2

<    1   2   3   4   >