diff --git a/Nim-for-Python-Programmers.md b/Nim-for-Python-Programmers.md index bbab0a8..4828b4b 100644 --- a/Nim-for-Python-Programmers.md +++ b/Nim-for-Python-Programmers.md @@ -106,7 +106,7 @@ var c = Cat(name: "Tom") c.increase_age() echo c.name, " ", c.age ``` - +Tip: use objects by reference ### Inheritance @@ -130,7 +130,14 @@ So, when using inheritance, be sure to inherit using refs, unless you know what ### Python tuples -Nim Tuples are close to Python nametuples, see [manual](http://nim-lang.org/manual.html#tuples-and-object-types) +Nim Tuples are close to Python nametuples, see [manual](http://nim-lang.org/manual.html#tuples-and-object-types). +Use Nim arrays: +``` Nim +var a = ["hi", "there"] +var b = [1, 2, 3] +echo b[1] +var c = ["hi", 1] # no mixed types please +``` ### Python sets