Somebody just showed me an old PDF version of A byte of Python. According to itself, it’s version 3.0 (of the book, not of Python) and from 2014. In the section Operators, there is a section that goes
#(less than or equal to)Returns whether x is less than or equal to y
x = 3; y = 6; x # yreturnsTrue.
In Python 2.7 and Python 3.6, this clearly wrong. Also this would be very bad design since # is also the comment operator.
The current version changed this from # to <=.
I am curious why the old version claimed this.
<=) into one (#).Version 3.0 of the book was written in AsciiDoc. This markup language defines special meaning to some constructs like the Double left arrow <= which is converted to the single Unicode character ⇐ on transformation to the final output. This is documented in its syntax description at https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#text-replacement
Now, it appears that during conversation to PDF, this character was lost and replaced with a pound character. This (as well as the initial conversation of the <= sequence to the arrow character itself) is obviously a bug.
Since the current version of the book was converted to Markdown, this bug was fixed there already. You thus likely want to use the current version of the book instead which you can download from GitBook.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With