diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2013-09-04 19:13:24 (GMT) |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2013-09-04 19:13:24 (GMT) |
commit | 95fc9cc2795c28b64e1648f997ff47daa474a1b1 (patch) | |
tree | fbeff6ca27e714dbec2e62a58fd85370b7276187 | |
parent | dcc0955e675e19b0e8f1ac12bd4312cba5fac233 (diff) |
Add some notes and bugs found while presenting part 2
8 files changed, 187 insertions, 0 deletions
diff --git a/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/01d029f4-730e-4889-809b-d2395c1a19c6/comments/c91d8d1c-7010-4613-8ee8-9bb39e83bc3f/body b/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/01d029f4-730e-4889-809b-d2395c1a19c6/comments/c91d8d1c-7010-4613-8ee8-9bb39e83bc3f/body new file mode 100644 index 0000000..264f9aa --- /dev/null +++ b/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/01d029f4-730e-4889-809b-d2395c1a19c6/comments/c91d8d1c-7010-4613-8ee8-9bb39e83bc3f/body @@ -0,0 +1 @@ +"""This isn’t actually a comment, it’s a string.""" diff --git a/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/01d029f4-730e-4889-809b-d2395c1a19c6/comments/c91d8d1c-7010-4613-8ee8-9bb39e83bc3f/values b/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/01d029f4-730e-4889-809b-d2395c1a19c6/comments/c91d8d1c-7010-4613-8ee8-9bb39e83bc3f/values new file mode 100644 index 0000000..0603c8c --- /dev/null +++ b/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/01d029f4-730e-4889-809b-d2395c1a19c6/comments/c91d8d1c-7010-4613-8ee8-9bb39e83bc3f/values @@ -0,0 +1,29 @@ +{ + + + + + + + "Author": "Philip Withnall <philip@tecnocode.co.uk>", + + + + + + + "Content-type": "text/plain", + + + + + + + "Date": "Wed, 04 Sep 2013 19:13:14 +0000" + + + + + + +} diff --git a/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/01d029f4-730e-4889-809b-d2395c1a19c6/values b/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/01d029f4-730e-4889-809b-d2395c1a19c6/values new file mode 100644 index 0000000..c8d8e08 --- /dev/null +++ b/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/01d029f4-730e-4889-809b-d2395c1a19c6/values @@ -0,0 +1,50 @@ +{ + + + + + + + "creator": "Philip Withnall <philip@tecnocode.co.uk>", + + + + + + + "reporter": "Philip Withnall <philip@tecnocode.co.uk>", + + + + + + + "severity": "minor", + + + + + + + "status": "open", + + + + + + + "summary": "Update slides on comments", + + + + + + + "time": "Wed, 04 Sep 2013 19:12:58 +0000" + + + + + + +} diff --git a/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/790b8006-bef9-4cf4-875b-a8e2c3074de6/comments/d4158159-bc1c-419c-b932-96968bfc7a27/body b/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/790b8006-bef9-4cf4-875b-a8e2c3074de6/comments/d4158159-bc1c-419c-b932-96968bfc7a27/body new file mode 100644 index 0000000..ed34e93 --- /dev/null +++ b/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/790b8006-bef9-4cf4-875b-a8e2c3074de6/comments/d4158159-bc1c-419c-b932-96968bfc7a27/body @@ -0,0 +1,2 @@ +Add a class inheritance diagram in the ‘Classes’ section which shows the +inheritance between object, Vehiculo, Coche and Moto. diff --git a/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/790b8006-bef9-4cf4-875b-a8e2c3074de6/comments/d4158159-bc1c-419c-b932-96968bfc7a27/values b/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/790b8006-bef9-4cf4-875b-a8e2c3074de6/comments/d4158159-bc1c-419c-b932-96968bfc7a27/values new file mode 100644 index 0000000..5cf5feb --- /dev/null +++ b/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/790b8006-bef9-4cf4-875b-a8e2c3074de6/comments/d4158159-bc1c-419c-b932-96968bfc7a27/values @@ -0,0 +1,29 @@ +{ + + + + + + + "Author": "Philip Withnall <philip@tecnocode.co.uk>", + + + + + + + "Content-type": "text/plain", + + + + + + + "Date": "Wed, 04 Sep 2013 19:00:36 +0000" + + + + + + +} diff --git a/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/790b8006-bef9-4cf4-875b-a8e2c3074de6/values b/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/790b8006-bef9-4cf4-875b-a8e2c3074de6/values new file mode 100644 index 0000000..11a5195 --- /dev/null +++ b/.be/dcda61d1-5133-456a-b88c-6bf21e61777b/bugs/790b8006-bef9-4cf4-875b-a8e2c3074de6/values @@ -0,0 +1,50 @@ +{ + + + + + + + "creator": "Philip Withnall <philip@tecnocode.co.uk>", + + + + + + + "reporter": "Philip Withnall <philip@tecnocode.co.uk>", + + + + + + + "severity": "minor", + + + + + + + "status": "open", + + + + + + + "summary": "Add a class inheritance diagram", + + + + + + + "time": "Wed, 04 Sep 2013 18:59:27 +0000" + + + + + + +} diff --git a/python-functions-and-classes.tex b/python-functions-and-classes.tex index c6f5ba0..ff28729 100644 --- a/python-functions-and-classes.tex +++ b/python-functions-and-classes.tex @@ -2,6 +2,8 @@ \section{\en{Functions}\es{Funciones}} +\note{Before starting, ask how everyone got on with the exercises from part 1.} + \en{We've already seen how to call existing functions; now we'll see how to define new ones. As with loops and conditionals, a function is a block of code which is indented by 4 spaces relative to the name of the function, which is @@ -113,6 +115,9 @@ def factorial(n): \end{lstlisting} \end{frame} +\note{Demonstrate this by adding a trace \texttt{print()} statement at the top + of \texttt{factorial()}.} + \section{\en{Imports}\es{Importaciónes}} @@ -157,6 +162,9 @@ from sys import argv \end{lstlisting} \end{frame} +\note{Demonstrate this in the interpreter by calling \texttt{math.sin()} before + and after \texttt{import~python}.} + \en{Python modules can be arranged in hierarchies, with the modules named after the files and directories which contain the code. For example, \texttt{repository} is a sub-module of \texttt{gi}. When referencing a class @@ -324,6 +332,9 @@ class Moto(Vehiculo): \end{lstlisting} \end{frame} +\note{Demonstrate in the interpreter what happens when \texttt{self} is omitted + from the parameter list of \texttt{\_\_init\_\_()}.} + \begin{frame}[fragile] \frametitle{\en{Defining classes}\es{Definición de clases}} \begin{lstlisting}[language=Python] @@ -382,6 +393,12 @@ class Coche(Vehiculo): \end{lstlisting} \end{frame} +\note{Demonstrate in the interpreter by creating a class with a public method + and a private method, instantiating the class, and then attempting to call + the two methods. This will show the error when calling a private method. + Also include a call to the private method from within the class, for + comparison.} + \subsection{\en{Properties}\es{Propriedades}} @@ -499,6 +516,11 @@ print(range.__doc__) \end{lstlisting} \end{frame} +\note{Demonstrate in the interpreter by creating a class with two methods, one + with a correct docstring, and one with its docstring in the wrong place. + Try printing the \texttt{\_\_doc\_\_} members of each to demonstrate the + failure.} + \section{\en{Code formatting}\es{Formato de código}} @@ -523,6 +545,8 @@ publicar un programa para el público.} \end{itemize} \end{frame} +\note{Demonstrate with some correct and incorrect Python files.} + \section{\en{UIs with GTK+}\es{UIs con GTK+}} diff --git a/writing-sugar-activities.tex b/writing-sugar-activities.tex index 59a214c..fad1e0c 100644 --- a/writing-sugar-activities.tex +++ b/writing-sugar-activities.tex @@ -2,6 +2,8 @@ \section{\en{Overview of Sugar and GTK+}\es{Visión general de Sugar y GTK+}} +\note{Before starting, ask how everyone got on with the exercises from part 2.} + \en{The Sugar platform is what runs on the XO. Sugar itself is written in Python, but uses a system called GTK+ as its underlying UI toolkit. GTK+ is a popular UI toolkit, used by many projects on Linux (not just on the XO).} |