Message245082
(see https://mail.python.org/mailman/listinfo/python-ideas)
But for x = [1,2,3,4], how will x[y] work for all of the following values of y?
y = slice.literal[0]
y = slice.literal[1:2]
y = slice.literal[0:1, ..., 3]
NumPy's s_ "magic object" is a factory, returning objects of different types depending on the given input. If you want an actual slice.literal class, then you'll have to supply a way to convert it into an object usable for indexing/slicing, e.g.:
y = slice.literal[0:1]
[1,2,3,4][y.as_indexer] |
|
Date |
User |
Action |
Args |
2015-06-09 19:17:04 | taleinat | set | recipients:
+ taleinat, rhettinger, mark.dickinson, Arfrever, steven.daprano, serhiy.storchaka, llllllllll |
2015-06-09 19:17:04 | taleinat | set | messageid: <1433877424.34.0.506143746411.issue24379@psf.upfronthosting.co.za> |
2015-06-09 19:17:04 | taleinat | link | issue24379 messages |
2015-06-09 19:17:03 | taleinat | create | |
|