Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #98018

Re: [ANN] Python 3 Cheat Sheet v2.0

From Laurent Pointal <laurent.pointal@free.fr>
Subject Re: [ANN] Python 3 Cheat Sheet v2.0
Newsgroups comp.lang.python
References <5633cb68$0$21247$426a74cc@news.free.fr> <56341659$0$1587$c3e8da3$5496439d@news.astraweb.com>
Date 2015-10-31 16:20 +0000
Message-ID <5634ea46$0$3195$426a74cc@news.free.fr> (permalink)
Organization Guest of ProXad - France

Show all headers | View raw


Le Sat, 31 Oct 2015 12:16:08 +1100, Steven D'Aprano a écrit :

> On Sat, 31 Oct 2015 06:56 am, Laurent Pointal wrote:
>>         https://perso.limsi.fr/pointal/python:memento
> 
> 
> Very nice! Thank you!
> 
> 
> Some small typos in the English version:


Thanks for your comments.

Q? Did you read version 1.2.2 or version 2.0 ?

Some typos propagate between versions (I fixed the "litteral"s), but I 
modified some parts (ex. for while loops the warning become "beware of 
infinite loops !" [I still have a space to remove before ! french/english 
typo differences]


> Some errors of fact:
> 
> Page 2, Generator of int sequences:
> 
> "range returns a «generator»"
> 
> This is not correct, `range` returns a lazy immutable sequence where the
> values are constructed as needed, not in advance.
> 
> https://docs.python.org/3/library/functions.html#func-range

Now (v2.0) range is presented as an integer sequence - without detail, 
dont know if beginners understand 'lasy' in our meaning.
 
> Page 2, Files:
> 
> "text file → read/write only strings, convert from/to required type"
> 
> While that is true for text files, it implies that open() always uses
> text files. This is not correct. You can open binary files too, and
> read/write raw bytes:
> 
> https://docs.python.org/3/library/functions.html#open
> https://docs.python.org/3/glossary.html#term-binary-file

Our students mainly work with text files, they have to convert all other 
values to str before writing. Its hard to be more complete within the 
remaining space. I'll see if I can add a small sentence about "text by 
default but can be binary with bytes content"

Thanks.
A+
Laurent.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[ANN] Python 3 Cheat Sheet v2.0 Laurent Pointal <laurent.pointal@free.fr> - 2015-10-30 19:56 +0000
  Re: [ANN] Python 3 Cheat Sheet v2.0 Steven D'Aprano <steve@pearwood.info> - 2015-10-31 12:16 +1100
    Re: [ANN] Python 3 Cheat Sheet v2.0 Laurent Pointal <laurent.pointal@free.fr> - 2015-10-31 16:20 +0000

csiph-web