[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-19 Thread Martin v . Löwis
Changes by Martin v. Löwis : -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-19 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Éric Araujo writes: >> That's fair enough. > > :) Do you want to close this feature request then? Me? No. I just figured that after all this arguing, I should mention that closing it as out of scope is not something I'll be difficult about. --

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-16 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: -haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-16 Thread Éric Araujo
Éric Araujo added the comment: > That's fair enough. :) Do you want to close this feature request then? -- ___ Python tracker ___ __

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-15 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Éric Araujo writes: > I think 2to3 is designed to take 2.x code and turn it into 3.x code. > Codebases using tricks and hacks to support both 2.x and 3.x (like the > example you linked to) cannot be handled by 2to3. That's fair enough. -- ___

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-15 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Hallvard B Furuseth writes: >Martin v. Löwis writes: >> Ok, I can propose two different spellings of this without any >> macro processor: (...) > > Both your examples fit my request perfectly. Pieces of code which I > presume are correct for both Python 2

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-15 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Martin v. Löwis writes: > As this code is in a Python 2.x block: why does this change cause > problems to you? You are supposed to run the 2to3 result in Python 3, > and this conversion result will run correctly in Python 3. As I've explained, and as the i

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: > Consider here: > http://www.sqlalchemy.org/trac/browser/lib/sqlalchemy/engine/base.py?rev=6884:b181f1e53603#L1329 > the py3k code uses the "raise ... from" syntax which isn't legal in Python 2. In this case, I would write error = exc.DBAPIError.instance

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-12 Thread Bobby Impollonia
Bobby Impollonia added the comment: Consider here: http://www.sqlalchemy.org/trac/browser/lib/sqlalchemy/engine/base.py?rev=6884:b181f1e53603#L1329 the py3k code uses the "raise ... from" syntax which isn't legal in Python 2. Using either "Approach A" or "Approach B" would prevent the program

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: > For example, starting on line 152 we have, > # Py3K > #return unicode(self.compile()) > # Py2K > return unicode(self.compile()).\ > encode('ascii', 'backslashreplace') > # end Py2K Ok, I can pro

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-12 Thread Bobby Impollonia
Bobby Impollonia added the comment: > Can you please post an example Python module that has this markup you are > asking for, so I can show you how to achieve what you want without the markup? Hi, Martin. Here's a real-world example: http://www.sqlalchemy.org/trac/browser/lib/sqlalchemy/types.

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: I don't understand the example, either. If I run 2to3 on it, I get, as the only change if sys.version_info[0] < 3: # Python 2 -from urllib import quote, unquote -from urlparse import urlparse, urlunparse -from BaseHT

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-12 Thread Éric Araujo
Éric Araujo added the comment: I think 2to3 is designed to take 2.x code and turn it into 3.x code. Codebases using tricks and hacks to support both 2.x and 3.x (like the example you linked to) cannot be handled by 2to3. You have to make a choice between manual maintenance of parallel codeb

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-12 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Martin v. Löwis writes: > And I still don't understand the rationale for this request. Can you > please post an example Python module that has this markup you are asking > for, so I can show you how to achieve what you want without the markup? Eh. I thou

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-09 Thread Martin v . Löwis
Martin v. Löwis added the comment: And I still don't understand the rationale for this request. Can you please post an example Python module that has this markup you are asking for, so I can show you how to achieve what you want without the markup? --

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-09 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Hi, I'm back... I've been reading your last message a few times and I'm not sure what I'm to reconsider. We've had a way of talking past each toerh before, as far as I can remember. I think my request still now translates to: - keep the current behavior

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-04 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: >> I don't think this can work. You may have to write code like >> >> if sys.version_info >= (3,): >> try: >> some_code() >> except Exception, e: >> pass >> >> (i.e. not use the "as" syntax), because it otherwise won't parse on >> Python 2. Hence, o

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: [I got failed issue tracker submission, trying again...] >> How about this phrasing: “Make 2to3 fixers not touch code in a >> block starting with ’if sys.version >= '3'’“ >> (and hexversion, version_info, you get the idea)? Right, almost... it doesn't nee

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: > How about this phrasing: “Make 2to3 fixers not touch code in a block > starting with ’if sys.version >= '3'’“ (and hexversion, version_info, > you get the idea)? I don't think this can work. You may have to write code like if sys.version_info >= (3,): try

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Éric Araujo
Éric Araujo added the comment: How about this phrasing: “Make 2to3 fixers not touch code in a block starting with ’if sys.version >= '3'’“ (and hexversion, version_info, you get the idea)? -- ___ Python tracker _

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +benjamin.peterson, eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Another syntax could be attached to if-else and try-except. Given: if ...: else: or try: except ...: if 2to3 would translate to or vise versa, sans whitespace/comment differences, then it does not do

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: > Maybe we need to tackle this from a different angle: can you please > specify the feature you are asking for exactly, with any syntax, API, or > command line changes that you consider necessary? First, nothing here is necessary, since it's just a request

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: Maybe we need to tackle this from a different angle: can you please specify the feature you are asking for exactly, with any syntax, API, or command line changes that you consider necessary? Omitting redundant parentheses for print is a separate issue (feel

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Martin v. Löwis writes: > I still don't understand. If it's 2.x code, why do you want to say that > it is 3.x code? It works on Python 2. It runs on Python 3 - maybe correctly, or maybe it's not that far along yet. Maybe some files in a package work on

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: I still don't understand. If it's 2.x code, why do you want to say that it is 3.x code? If you don't want to run a specific fixer, you can exclude it from the list of fixers. -- ___ Python tracker

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Martin v. Löwis writes: > Martin v. Löwis added the comment: > > I don't understand. If the code is already Python 3 code, why are you > running 2to3 on it? I should have clarified - it's still Python 2 code (maybe 2.7), moving one step at a time toward

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: I don't understand. If the code is already Python 3 code, why are you running 2to3 on it? -- nosy: +loewis ___ Python tracker ___ ___

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : It would be nice with some official way to tell 2to3, "Leave this code chunk alone. This is 2.* code, that is 3.* code": try: # Python 2.6 from urlparse import urlparse, urlunparse except ImportError: # Python 3