Quellcode durchsuchen

Overcoming weird parsing by Asciidoctor

via reader email on 21-Nov-2014:

----
Hi Swaroop,

I like A Byte of Python very much, I recommended it to python learners many times, last weekend one
of them(actually my girlfriend) told me why not use the "self.class" attribute instead of the
__class__ that I have taught her. Then I found the misunderstanding was from the ABP website
http://www.swaroopch.com/notes/python/ , for all the double underlined words have become italic. I
guess it's related to markdown somehow, because we have meet the exactly same problem, which kills
a lot of '*'.

Just remind you, in case you don't know the problem there, and a lot of learners will suffer, for
this book is so famous :)

best wishes,
Dan
----
Swaroop C H vor 10 Jahren
Ursprung
Commit
61f71eb0c7
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 2 2
      basics.asciidoc
  2. 2 2
      oop.asciidoc

+ 2 - 2
basics.asciidoc

@@ -285,8 +285,8 @@ are some rules you have to follow for naming identifiers:
   Unicode character), underscores (`_`) or digits (0-9).
 - Identifier names are case-sensitive. For example, `myname` and `myName` are _not_ the same. Note
   the lowercase `n` in the former and the uppercase `N` in the latter.
-- Examples of _valid_ identifier names are `i`, `__my_name`, `name_23`. Examples of _invalid_
-  identifier names are `2things`, `this is spaced out`, `my-name` and `>a1b2_c3`.
+- Examples of _valid_ identifier names are `i`, `name_2_3`. Examples of _invalid_ identifier names
+  are `2things`, `this is spaced out`, `my-name` and `>a1b2_c3`.
 
 === Data Types
 

+ 2 - 2
oop.asciidoc

@@ -200,8 +200,8 @@ Thus, we refer to the `population` class variable as `Robot.population` and not
 of that object. Remember this simple difference between class and object variables. Also note that
 an object variable with the same name as a class variable will hide the class variable!
 
-Instead of `Robot.population`, we could have also used `self.__class__.population` because every
-object refers to it's class via the `self.__class__` attribute.
+Instead of `Robot.population`, we could have also used +self.__class__.population+ because every
+object refers to it's class via the +self.__class__+ attribute.
 
 The `how_many` is actually a method that belongs to the class and not to the object. This means we
 can define it as either a `classmethod` or a `staticmethod` depending on whether we need to know