nteract/papermill

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

オープン

#396 opened on 2019/07/05

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)Python (402 件のフォーク)batch import
enhancementhelp wantedidea

Repository metrics

Stars
 (5,381 個のスター)
PR merge metrics
 (PR metrics pending)

説明

-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?

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