浏览代码

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 10 年之前
父节点
当前提交
61f71eb0c7
共有 2 个文件被更改,包括 4 次插入4 次删除
  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).
   Unicode character), underscores (`_`) or digits (0-9).
 - Identifier names are case-sensitive. For example, `myname` and `myName` are _not_ the same. Note
 - 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.
   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
 === 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
 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!
 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
 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
 can define it as either a `classmethod` or a `staticmethod` depending on whether we need to know