On 2016-01-16 18:02, Cameron Simpson wrote:
On 16Jan2016 18:43, boB Stepp <robertvst...@gmail.com> wrote:
This led me to try:

mylist[:None]
[100, 200, 300, 400, 500]

So, in effect, None is acting as a place holder for that final
position in slices.  Also, I would never have thought to be able to
use a logical "or" inside an index in Peter's "[:-i or None]".

Yah, like the default value for many missing parameters. When you
don't need an expression after the ":" you can of course write:

 mylist[:]

much like writing a function "def f(x, y=None)"; None is a sentinel
value - specially recognised as nor in the normal domain for that
value.


Can you please clarify the last bit:
"specially recognised as nor in the normal domain for that value."

thanks,
Alex
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to