bslatkin / effectivepython

Effective Python: Second Edition — Source Code and Errata for the Book
https://effectivepython.com
2.24k stars 718 forks source link

item 11, page 44, note at the bottom of the page #85

Open srob1 opened 4 years ago

srob1 commented 4 years ago

The note at the bottom of page 44 (item 11) states:

"the expression somelist[-n:] will work fine when n is greater than one..."

I believe this should say "greater than zero" rather than "greater than one":

"the expression somelist[-n:] will work fine when n is greater than zero..."

since somelist[-1:] works just fine and slices the last item of somelist.

bslatkin commented 4 months ago

Thank you for the report. Yes that's right! I will change this.