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.

Author Alfonso Chavez
Recipients Alfonso Chavez, docs@python
Date 2018-04-21.11:50:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1524311402.18.0.682650639539.issue33324@psf.upfronthosting.co.za>
In-reply-to
Content
Hi. In https://docs.python.org/3/library/stdtypes.html#string-methods says:

str.center(width[, fillchar])

But, I tried in Windows 10 and Ubuntu Server:

>>> var = 'Variable de prueba'
>>> str.center(50, var)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: descriptor 'center' requires a 'str' object but received a 'int'

Then, I tried this:

>>> str.center(var, 50)
'                Variable de prueba                '

I think the documentation should read:
str.center(fillchar[, width])

Version in Windows: Python 3.6.5
Version in Ubuntu Server: Python 3.5.2
History
Date User Action Args
2018-04-21 11:50:02Alfonso Chavezsetrecipients: + Alfonso Chavez, docs@python
2018-04-21 11:50:02Alfonso Chavezsetmessageid: <1524311402.18.0.682650639539.issue33324@psf.upfronthosting.co.za>
2018-04-21 11:50:02Alfonso Chavezlinkissue33324 messages
2018-04-21 11:50:01Alfonso Chavezcreate