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.

Title: Document that compile() source may be bytes
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.3, Python 3.4
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Fotis.Koutoulakis, benjamin.peterson, docs@python, eric.araujo, gvanrossum, python-dev
Priority: low Keywords: easy, needs review, patch

Created on 2013-12-06 16:12 by gvanrossum, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
issue19910_python.patch Fotis.Koutoulakis, 2013-12-07 00:30 review
Messages (4)
msg205383 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2013-12-06 16:12
compile() takes a string, bytes or AST as the "source" argument.  The bytes option are not documented except in the error message you get when you pass something else.  The AST option is in the library docs but not in the function docstring.
msg205423 - (view) Author: Fotis Koutoulakis (Fotis.Koutoulakis) * Date: 2013-12-07 00:30
There we go. I have changed the references to compile(), both in the docstring, and the documentation so that it states clearly that a bytes object is also acceptable as the "source" argument.

I also fixed the docstring to mention explicitly that it can also accept an AST as the "source argument".

Since this is my very first contribution to Python, I welcome all feedback. Thanks for your time.
msg205424 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2013-12-07 00:36
Thanks!  Patch looks good to me.
msg205428 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-12-07 01:15
New changeset 500cc1acc42f by Benjamin Peterson in branch '3.3':
document that compile() can take bytes (closes #19910)

New changeset 44dacafdd48a by Benjamin Peterson in branch 'default':
merge 3.3 (#19910)
Date User Action Args
2022-04-11 14:57:55adminsetgithub: 64109
2013-12-07 01:15:03python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg205428

resolution: fixed
stage: patch review -> resolved
2013-12-07 00:59:58pitrousetnosy: + benjamin.peterson
2013-12-07 00:36:28eric.araujosetkeywords: + needs review

messages: + msg205424
stage: needs patch -> patch review
2013-12-07 00:30:49Fotis.Koutoulakissetfiles: + issue19910_python.patch

nosy: + Fotis.Koutoulakis
messages: + msg205423

keywords: + patch
2013-12-06 17:29:17eric.araujosetnosy: + eric.araujo
2013-12-06 16:14:31gvanrossumsetkeywords: + easy
priority: normal -> low
stage: needs patch
2013-12-06 16:12:46gvanrossumcreate