Skip to content

Commit 0d1dbad

Browse files
committed
minor changes in in doc subtelities.rst
1 parent 64a9eac commit 0d1dbad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/user/subtelties.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ It can then be instantiated in the axiom and modified during the simulation::
1818
Axiom: Apex(ApexParameters(age=0))
1919
dt = 1
2020
derivation length: 2
21+
production:
2122
Apex(p) :
2223
p.age += dt
2324
produce Node() Apex(p)
@@ -26,12 +27,12 @@ Creating the lsystem and running it the first time will produce the expected res
2627

2728
>>> l = Lsystem('mycode.lpy')
2829
>>> lstring = l.derive()
29-
>>> print lstring
30+
>>> print(lstring)
3031
Node()Node()Apex(ApexParameters(age=2))
3132

3233
However, a strange behavior occurs when asking for the axiom.::
3334

34-
>>> print l.axiom
35+
>>> print(l.axiom)
3536
Apex(ApexParameters(age=2))
3637

3738
In fact, this behavior is due to the way python manage object. By default, complex objects
@@ -40,7 +41,7 @@ are not copied but simply shared between variables.::
4041
>>> a = ApexParameters(age=0)
4142
>>> b = a
4243
>>> b.age = 2
43-
>>> print a.age
44+
>>> print(a.age)
4445
2
4546

4647
The variables ``b`` and ``a`` point toward the same object in memory. This one will be destroyed only when no variable

0 commit comments

Comments
 (0)