Skip to content

Commit

Permalink
[doc] add warning about limitations of to_python depending on the pyt…
Browse files Browse the repository at this point in the history
…hon version
  • Loading branch information
Psycojoker committed Sep 5, 2017
1 parent fb27ea7 commit 70d5e5f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/other.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,14 @@ expect the number of spaces to add or to remove as first argument.
.to_python()
------------

.. WARNING::

Since RedBaron calls `literal_eval` it can only parse the python code parsed
by the python version you are using.

For example if you are using a python version inferior to 3.6, `to_python`
will crash on `100_000` because it is only supported since python 3.6

This method safely evaluate the current selected nodes. It wraps
`ast.literal_eval
<https://docs.python.org/2/library/ast.html#ast.literal_eval>`_, therefor, and
Expand Down

0 comments on commit 70d5e5f

Please sign in to comment.