[New-bugs-announce] [issue28798] Describe character as a string of length one instead of size one in tutorial

Liang-Bo Wang report at bugs.python.org
Thu Nov 24 23:29:35 EST 2016


New submission from Liang-Bo Wang:

In Tutorial "An Informal Introduction" section, character is introduced as a string of size one. It may be true for python 2.x, where str can be interpreted as bytes. However in Python 3, strings are unicode thus the size and the length of a string are usually not the same. Also, using size of a string can be confused with the result returned by sys.getsizeof(mystr), where sys.getsizeof('a') != 1. 

Therefore using "a string of length one" to describe a character may be less confusing. The patch attached changes the wording.

----------
assignee: docs at python
components: Documentation
files: docs_tutorial_introduction_str.diff
keywords: patch
messages: 281678
nosy: ccwang002, docs at python
priority: normal
severity: normal
status: open
title: Describe character as a string of length one instead of size one in tutorial
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45634/docs_tutorial_introduction_str.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28798>
_______________________________________


More information about the New-bugs-announce mailing list