nteract/papermill

use `ast.literal_eval()` for `-p` params

Open

#396 opened on 2019年7月5日

GitHub で見る
 (1 comment) (0 reactions) (0 assignees)Python (402 forks)batch import
enhancementhelp wantedidea

Repository metrics

Stars
 (5,381 stars)
PR merge metrics
 (30d に merged PR はありません)

説明

-p seems to imply literal evaluation rather than raw string (-r), thus it should use ast.literal_eval()

Example

papermill ... -p a 1 -r b 2 -p c '[1, 2]'

Current behaviour

# Parameters
a = 1
c = "[1, 2]"
b = "2"

Desired output

# Parameters
a = 1
b = "2"
c = [1, 2]

Any reason why this should not be the case?

コントリビューターガイド