Message374069
This appears to be a bug with the google colab site.
For whatever reason, if you try to evaluate a statement that is a line with a leading comma (afaik, never valid python), then colab does something wierd by wrapping the arguments in quotes, and evaluating them ...
Here, `>>>` denotes running python in a colab cell:
>>> type(1)
int
>>> ,type(1)
str
>>> ,type(1,2,3)
str
>>> ,type(1, 2, 3)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-38-a1b277d7db3e> in <module>()
----> 1 type("(1,", "2,", "3)")
TypeError: type.__new__() argument 2 must be tuple, not str
---
This is not reproducible in normal python, so seems extremely likely to be some (planned or unplanned) feature of google colab that's causing confusion here. |
|
Date |
User |
Action |
Args |
2020-07-21 15:53:11 | stestagg | set | recipients:
+ stestagg, eric.smith, Justin Hodder |
2020-07-21 15:53:11 | stestagg | set | messageid: <1595346791.2.0.292409282592.issue41337@roundup.psfhosted.org> |
2020-07-21 15:53:11 | stestagg | link | issue41337 messages |
2020-07-21 15:53:10 | stestagg | create | |
|