Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue18708] Change required in python 3.4 interpretor .

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Aug 10, 2013, 11:47 PM

Post #1 of 2 (17 views)
Permalink
[issue18708] Change required in python 3.4 interpretor .

New submission from madan ram:

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.

----------
components: Interpreter Core
messages: 194867
nosy: madan.ram, rhettinger
priority: normal
severity: normal
status: open
title: Change required in python 3.4 interpretor .
type: enhancement
versions: Python 3.4

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue18708>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 11, 2013, 5:04 AM

Post #2 of 2 (10 views)
Permalink
[issue18708] Change required in python 3.4 interpretor . [In reply to]

Mark Dickinson added the comment:

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.

----------
nosy: +mark.dickinson
resolution: -> rejected
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue18708>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.