diff options
Diffstat (limited to 'slides.html')
-rw-r--r-- | slides.html | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/slides.html b/slides.html index 950cc9c..68054f1 100644 --- a/slides.html +++ b/slides.html @@ -396,6 +396,8 @@ ul.auto-toc { <tbody valign="top"> <tr class="field"><th class="field-name">Author:</th><td class="field-body">Matěj Cepl <<a class="reference external" href="mailto:mcepl%40cepl.eu">mcepl<span>@</span>cepl<span>.</span>eu</a>></td> </tr> +<tr class="field"><th class="field-name">URL:</th><td class="field-body"><a class="reference external" href="https://matej.ceplovi.cz/clanky/PyCon18-m2crypto/slides.html">https://matej.ceplovi.cz/clanky/PyCon18-m2crypto/slides.html</a></td> +</tr> </tbody> </table> @@ -489,28 +491,11 @@ OpenSSL.</li> <h1>Strategy</h1> <ul class="simple"> <li>Type Hints</li> +<li>Documentation strings</li> <li>CI</li> <li>Extension of platform support</li> </ul> </div> -<div class="slide" id="type-hints"> -<h1>Type Hints</h1> -<ul> -<li><p class="first"><a class="reference external" href="https://www.python.org/dev/peps/pep-0484/">PEP 484</a> providing <strong>optional</strong> type annotations. Quite -controversial, but clearly very useful for libraries</p> -</li> -<li><p class="first">Native for Python >= 3.5, but supports py2k compatible syntax:</p> -<pre class="literal-block"> -def sum(x, y): - # type: (int, int) -> int - return x + y -</pre> -</li> -<li><p class="first">Especially useful for our situation: marking types helps us to -analyze what invidivual py2k <tt class="docutils literal">str</tt> actually mean.</p> -</li> -</ul> -</div> <div class="slide" id="c-api"> <h1>C API</h1> <ul class="simple"> @@ -541,6 +526,41 @@ py3k API</li> </li> </ul> </div> +<div class="slide" id="type-hints"> +<h1>Type Hints</h1> +<ul> +<li><p class="first"><a class="reference external" href="https://www.python.org/dev/peps/pep-0484/">PEP 484</a> providing <strong>optional</strong> type annotations. Quite +controversial, but clearly very useful for libraries</p> +</li> +<li><p class="first">Native for Python >= 3.5, but supports py2k compatible syntax:</p> +<pre class="literal-block"> +def sum(x, y): + # type: (int, int) -> int + return x + y +</pre> +</li> +<li><p class="first">Especially useful for our situation: marking types helps us to +analyze what invidivual py2k <tt class="docutils literal">str</tt> actually mean.</p> +</li> +</ul> +</div> +<div class="slide" id="python-porting-shims-again"> +<h1>Python porting (shims again)</h1> +<p>The same principles apply as with C functions, “shims, not +<tt class="docutils literal">#ifdef</tt> s”.</p> +<ul class="simple"> +<li>Plenty of issues are resolved by using <tt class="docutils literal">six</tt> (or +<tt class="docutils literal">modernize</tt>, <tt class="docutils literal">future</tt>), so use them. If I did it again, +I would probably use <tt class="docutils literal">future</tt> (and wrote py3k code), but the +difference is slim.</li> +<li>Do not hesitate to create your own shims. So I have for +example, <tt class="docutils literal">bix_to_hex</tt> and <tt class="docutils literal">oct_to_num</tt> or padding functions +there.</li> +<li><a class="reference external" href="http://python-future.org/compatible_idioms.html">http://python-future.org/compatible_idioms.html</a></li> +</ul> +<p class="handout">Whoever does not understand LISP, is doomed to reinvent it. +Badly. LISP -> six</p> +</div> </div> </body> </html> |