This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Change required in python 3.4 interpretor .
Type: enhancement Stage:
Components: Interpreter Core Versions: Python 3.4
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: madan.ram, mark.dickinson, rhettinger
Priority: normal Keywords:

Created on 2013-08-11 06:47 by madan.ram, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg194867 - (view) Author: madan ram (madan.ram) Date: 2013-08-11 06:47
As I observed when using python 3.4 Interpretor  is that it would be able to distinguish between char by '' and string by ""

>>> input()    
a
'a'

and 

>>> input()
aa
'aa'

it would be better if output was
"aa"

but if i want to fix this which file to edit.
msg194890 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2013-08-11 12:04
Unlike C, Python doesn't have any 'character' type:  the elements of a string are simply 1-character strings.  The two quote styles are mostly interchangeable:  again, unlike C, there's no particular meaning attached to the use of single quotes or double quotes.

So you'd be asking for 1-character strings to be represented using single quotes and multi-character strings to be representing using double quotes.  That doesn't seem like a particularly useful distinction.  Worse, it might even be misleading, since it would suggest a C-like distinction between characters and strings.

As to which file:  you're looking for the implementation of str.__repr__, which is in the unicode_repr function in Objects/unicodeobject.c.  The logic for choosing which style of quote to use is about 50 lines into that function (line 12128 at revision eeda59e08c83).

Closing this as rejected.
History
Date User Action Args
2022-04-11 14:57:49adminsetgithub: 62908
2013-08-11 12:04:35mark.dickinsonsetstatus: open -> closed

nosy: + mark.dickinson
messages: + msg194890

resolution: rejected
2013-08-11 06:47:16madan.ramcreate