[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2019-07-18 Thread Aldwin Pollefeyt


Aldwin Pollefeyt  added the comment:

* there were many small issues with the patch, improved as good as possible the 
FixString to catch ```import as```, ```from string import *``` and ```import 
string```

* did not include the FixStringImports as it's not a necessity to work in 
Python3

* indeed, some uses of the constant names that are user-defined will also 
rename, only when it's in a ```import string```. Added a ```Caution``` in the 
documentation. Still, when all are changed, it should not affect the Python3 
version, will just work with the renamed variable name.

--
nosy: +aldwinaldwin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2019-07-18 Thread Aldwin Pollefeyt


Change by Aldwin Pollefeyt :


--
pull_requests: +14626
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/14835

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2014-09-09 Thread Rose Ames

Rose Ames added the comment:

...

d) how to format code :\

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2014-09-09 Thread Rose Ames

Rose Ames added the comment:

Changing the imports only is straightforward, but I'm having trouble detecting 
and changing future uses of the variables, without also clobbering user-defined 
variables with the same names.

I notice some of the current fixers have similar problems, for example the 
itertools fixer changes:


```
def imap(): pass
imap()
```

to
 

```
def imap(): pass
map()
```

This patch is a little smarter than that, but it only detects top-level 
definitions.  For example, the lowercase in 


```
class Foo:
  def __init__(self):
self.lowercase = "blargh"
```

still gets renamed.

I can work on this more, but would like to know:

a) whether this fix is still wanted
b) how smart it needs to be
c) whether my approach is reasonable.  I feel like there should be an easier 
way.

--
keywords: +patch
nosy: +superluser
Added file: http://bugs.python.org/file36586/string_partial.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2014-07-27 Thread Anthony Kong

Changes by Anthony Kong :


--
nosy: +Anthony.Kong

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2014-06-28 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2014-06-28 Thread Mark Lawrence

Mark Lawrence added the comment:

@Ezio can you prepare a patch for this?

--
nosy: +BreamoreBoy
versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2011-10-27 Thread Meador Inge

Changes by Meador Inge :


--
nosy: +meador.inge

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2011-10-27 Thread Ezio Melotti

New submission from Ezio Melotti :

$ cat deleteme.py 
from string import lowercase, uppercase, letters
print uppercase == 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
print lowercase == 'abcdefghijklmnopqrstuvwxyz'
print letters == 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
$ python deleteme.py 
True
True
True
$ 2to3 -w deleteme.py 
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: Refactored deleteme.py
--- deleteme.py (original)
+++ deleteme.py (refactored)
@@ -1,4 +1,4 @@
 from string import lowercase, uppercase, letters
-print uppercase == 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-print lowercase == 'abcdefghijklmnopqrstuvwxyz'
-print letters == 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
+print(uppercase == 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')
+print(lowercase == 'abcdefghijklmnopqrstuvwxyz')
+print(letters == 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
RefactoringTool: Files that were modified:
RefactoringTool: deleteme.py
$ python3 deleteme.py 
Traceback (most recent call last):
  File "deleteme.py", line 1, in 
from string import lowercase, uppercase, letters
ImportError: cannot import name lowercase

They should be renamed to ascii_*.

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 146475
nosy: benjamin.peterson, ezio.melotti
priority: normal
severity: normal
stage: test needed
status: open
title: 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com