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.
Created on 2012年01月09日 13:34 by barry, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| stringByteLiteralBR.docx | j.chadwick, 2012年03月29日 13:52 | Correct update to documentation | ||
| Messages (10) | |||
|---|---|---|---|
| msg150936 - (view) | Author: Barry A. Warsaw (barry) * (Python committer) | Date: 2012年01月09日 13:34 | |
The lexical analysis documentation says this: http://docs.python.org/py3k/reference/lexical_analysis.html?highlight=raw%20bytes "Bytes literals are always prefixed with 'b' or 'B';..." "Both string and bytes literals may optionally be prefixed with a letter 'r' or 'R';..." But that would lead you to believe that to get raw byte strings you should use rb"foo". In fact, that's a SyntaxError in Python 2.6+ and Python 3. What *does* work though is br"foo". Either Python should accept both spellings (harder) or the documentation should make it clear that the 'b' must preceded the 'r'. |
|||
| msg150940 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年01月09日 15:15 | |
> Either Python should accept both spellings +1. Been annoyed several times by this. |
|||
| msg150941 - (view) | Author: Barry A. Warsaw (barry) * (Python committer) | Date: 2012年01月09日 15:18 | |
On Jan 09, 2012, at 03:15 PM, Antoine Pitrou wrote: > >Antoine Pitrou <pitrou@free.fr> added the comment: > >> Either Python should accept both spellings > >+1. Been annoyed several times by this. The 64ドルk question: is this a new feature or a bug? :) |
|||
| msg150942 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年01月09日 15:35 | |
> The 64ドルk question: is this a new feature or a bug? :) Most certainly a feature... |
|||
| msg150944 - (view) | Author: Barry A. Warsaw (barry) * (Python committer) | Date: 2012年01月09日 15:44 | |
On Jan 09, 2012, at 03:35 PM, Antoine Pitrou wrote: > >Antoine Pitrou <pitrou@free.fr> added the comment: > >> The 64ドルk question: is this a new feature or a bug? :) > >Most certainly a feature... In that case, since we can only add the new prefixes to 3.3, I still think we need to fix the documentation to remove the confusion for stable releases. |
|||
| msg157046 - (view) | Author: Joseph Chadwick (j.chadwick) | Date: 2012年03月29日 13:43 | |
The attached replaces the text for the documentation in 2.4.1 between the lexical definitions table and the escape sequence table. The only change is the following addition to the paragraph on string and byte literals prefixed by 'r' or 'R': When a byte literal is prefixed with both 'r' or 'R' and 'b' or 'B', the b must precede the r, as in: 'Br', 'bR', or 'BR' and not 'Rb', 'rB', or 'RB'. |
|||
| msg157047 - (view) | Author: Joseph Chadwick (j.chadwick) | Date: 2012年03月29日 13:52 | |
I uploaded before making the final save, so the first document is incomplete. (that's embarrassing) |
|||
| msg157122 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2012年03月30日 02:52 | |
Thanks for the contribution. Could you post your suggested wording as a plain text file? |
|||
| msg157123 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2012年03月30日 02:53 | |
Actually it’s fine, we already have the text in your message :) |
|||
| msg199667 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2013年10月13日 08:01 | |
3.3 is now released with both "br" and "rb" allowed, and in 2.7 the current text looks good enough for me. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:25 | admin | set | github: 57953 |
| 2013年10月13日 08:01:56 | georg.brandl | set | status: open -> closed nosy: + georg.brandl messages: + msg199667 resolution: out of date |
| 2012年03月30日 02:53:17 | eric.araujo | set | messages: + msg157123 |
| 2012年03月30日 02:52:30 | eric.araujo | set | nosy:
+ eric.araujo messages: + msg157122 |
| 2012年03月29日 14:19:53 | loewis | set | files: - stringByteLiteralBR.docx |
| 2012年03月29日 13:52:28 | j.chadwick | set | files:
+ stringByteLiteralBR.docx messages: + msg157047 |
| 2012年03月29日 13:43:12 | j.chadwick | set | files:
+ stringByteLiteralBR.docx nosy: + j.chadwick messages: + msg157046 type: enhancement |
| 2012年01月14日 05:13:01 | terry.reedy | set | nosy:
+ terry.reedy versions: - Python 3.1 |
| 2012年01月09日 15:44:35 | barry | set | messages: + msg150944 |
| 2012年01月09日 15:35:50 | pitrou | set | messages: + msg150942 |
| 2012年01月09日 15:18:46 | barry | set | messages: + msg150941 |
| 2012年01月09日 15:15:20 | pitrou | set | nosy:
+ gvanrossum, pitrou messages: + msg150940 |
| 2012年01月09日 13:34:21 | barry | create | |