Skip to content

Updated type of source in compile() from Any - #1524

Closed
ashwch wants to merge 1 commit into
python:masterfrom
ashwch:improve-compile-source-type
Closed

ashwch wants to merge 1 commit into
python:masterfrom
ashwch:improve-compile-source-type

Conversation

@ashwch

@ashwch ashwch commented Aug 6, 2017

Copy link
Copy Markdown
Contributor

Python 2:

source can either be a Unicode string, a Latin-1 encoded string or an AST object.

Python 3:

source can either be a normal string, a byte string, or an AST object.

@gvanrossum

Copy link
Copy Markdown
Member

Hm... The mypy test failures seem to be due to 3f9fafb (#1515). This would seem strange, but I think it is due to the addition of a dependency from builtins on ast (and implicitly on _ast). The builtins module and a small number of others are part of an import cycle that is always imported (because everything depends on builtins), and within this import cycle, strange things happen because it's part of bootstrapping the basic types.

Alas, I don't know how to fix this -- but I think it's wise to just close this rather than to try and worry too much about it.

@ashwch

ashwch commented Aug 7, 2017

Copy link
Copy Markdown
Contributor Author

Ouch! :-(

@ashwch ashwch closed this Aug 7, 2017
@ashwch
ashwch deleted the improve-compile-source-type branch August 7, 2017 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants