extended types
authorMart Lubbers <mart@martlubbers.net>
Fri, 4 Mar 2016 12:02:35 +0000 (13:02 +0100)
committerMart Lubbers <mart@martlubbers.net>
Fri, 4 Mar 2016 12:02:35 +0000 (13:02 +0100)
p.tex

diff --git a/p.tex b/p.tex
index ce9f3e8..25a4693 100644 (file)
--- a/p.tex
+++ b/p.tex
@@ -50,30 +50,41 @@ print(str(i/46) + ' hoi')
 
 \section{Basics}
 \begin{frame}[fragile]
-       \frametitle{Basictypes}
-       \begin{block}{types}
-               \begin{tabular}{ll}
-                       \mintinline{python}{bool} & \mintinline{python}{True, False}\\
-                       \mintinline{python}{int} & \mintinline{python}{1, -4, 999}\\
-                       \mintinline{python}{complex} & \mintinline{python}{4j+1, j}\\
-                       \mintinline{python}{float} & \mintinline{python}
-                               {1.0, 4.5, 5e9, float('NaN'), float('inf')}\\
-                       \mintinline{python}{str} & \mintinline{python}
-                               {'hi', "hi", '"', "'", """hi"""}\\
-                       \mintinline{python}{list} & \mintinline{python}
-                               {[], ..., [1, 2, 3], ['a', 42], [[], [1]]}\\
-                       \mintinline{python}{tuple} & \mintinline{python}
-                               {(1,), (1,2), (1, 'a', True), ((4, 3), 4)}
-               \end{tabular}
-       \end{block}
+       \frametitle{Built-in types}
+       \begin{tabular}{ll}
+               \mintinline{python}{bool} & \mintinline{python}{True, False}\\
+               \mintinline{python}{int} & \mintinline{python}{1, -4, 999}\\
+               \mintinline{python}{complex} & \mintinline{python}{4j+1, j}\\
+               \mintinline{python}{float} & \mintinline{python}
+                       {1.0, 4.5, 5e9, float('NaN'), float('inf')}\\
+               \mintinline{python}{str} & \mintinline{python}
+                       {'hi', "hi", '"', "'", """hi""", "\n\"\t", '\"'}\\
+               \mintinline{python}{list} & \mintinline{python}
+                       {[], ..., [1, 2, 3], ['a', 42], [[], [1]]}\\
+               \mintinline{python}{tuple} & \mintinline{python}
+                       {(1,), (1,2), (1, 'a', True), ((4, 3), 4)}\\
+               \mintinline{python}{dict} & \mintinline{python}
+                       {{1: 'a', 2: 'b'}, {"hi": 42, "test": {}}, {}}\\
+               \mintinline{python}{set} & \mintinline{python}
+                       {{1, 2}, {"hi", "a"}, set()}\\
+               Others &  \mintinline{python}
+                       {range, bytes, bytearray, memoryview, frozenset}\\
+               Special & \mintinline{python}
+                       {type, None, ..., NotImplemented}\\
+       \end{tabular}
+\end{frame}
+
+\begin{frame}[fragile]
+       \frametitle{Basictypes: Operators}
        \begin{block}{operators}
                \begin{itemize}
                        \item Numbers: \mintinline{python}{+ - / * // % @ **}
-                       \item Comparison: \mintinline{python}{< <= > >= == != is}
+                       \item Comparison: \mintinline{python}{< <= > >= == !=}
                        \item Boolean: \mintinline{python}{and or not}
                        \item Bitwise: \mintinline{python}{& | ^ ~ << >>}
-                       \item List: \mintinline{python}{[i] [i:j] in}
+                       \item List/Dictionary: \mintinline{python}{[i] [i:j] in}
                        \item In place: \mintinline{python}{*= += ...}
+                       \item Special: \mintinline{python}{is}
                \end{itemize}
        \end{block}
 \end{frame}