From 2e2587717e60d658cc32fd2b108474711b7aa1d2 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Wed, 30 May 2018 21:27:48 +0200 Subject: Rearrange slides --- slides.html | 56 +++++++++++++++++++++++++++++++++++----------------- slides.odp | Bin 10497 -> 10925 bytes slides.pdf | Bin 36680 -> 38440 bytes slides.rst | 64 ++++++++++++++++++++++++++++++++++++++++++------------------ 4 files changed, 83 insertions(+), 37 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 { Author:Matěj Cepl <mcepl@cepl.eu> +URL:https://matej.ceplovi.cz/clanky/PyCon18-m2crypto/slides.html + @@ -489,28 +491,11 @@ OpenSSL.

Strategy

-
-

Type Hints

- -

C API

+
+

Type Hints

+ +
+
+

Python porting (shims again)

+

The same principles apply as with C functions, “shims, not +#ifdef s”.

+ +

Whoever does not understand LISP, is doomed to reinvent it. +Badly. LISP -> six

+
diff --git a/slides.odp b/slides.odp index 177b054..ccad96c 100644 Binary files a/slides.odp and b/slides.odp differ diff --git a/slides.pdf b/slides.pdf index f196772..2b17632 100644 Binary files a/slides.pdf and b/slides.pdf differ diff --git a/slides.rst b/slides.rst index 4777bfe..8a48b9d 100644 --- a/slides.rst +++ b/slides.rst @@ -5,6 +5,7 @@ Wounded hero revived Lessons learned from porting M2Crypto to Py3k :Author: Matěj Cepl +:URL: https://matej.ceplovi.cz/clanky/PyCon18-m2crypto/slides.html Origins @@ -149,30 +150,13 @@ Strategy * Type Hints +* Documentation strings + * CI * Extension of platform support -Type Hints -========== - -* `PEP 484`_ providing **optional** type annotations. Quite - controversial, but clearly very useful for libraries - -* Native for Python >= 3.5, but supports py2k compatible syntax:: - - def sum(x, y): - # type: (int, int) -> int - return x + y - -* Especially useful for our situation: marking types helps us to - analyze what invidivual py2k ``str`` actually mean. - -.. _`PEP 484`: - https://www.python.org/dev/peps/pep-0484/ - - C API ===== @@ -205,3 +189,45 @@ C shims of missing functions - ``PyFile_AsFile()`` I have no idea, why it was removed from py3k API + + +Type Hints +========== + +* `PEP 484`_ providing **optional** type annotations. Quite + controversial, but clearly very useful for libraries + +* Native for Python >= 3.5, but supports py2k compatible syntax:: + + def sum(x, y): + # type: (int, int) -> int + return x + y + +* Especially useful for our situation: marking types helps us to + analyze what invidivual py2k ``str`` actually mean. + +.. _`PEP 484`: + https://www.python.org/dev/peps/pep-0484/ + + +Python porting (shims again) +============================ + +The same principles apply as with C functions, “shims, not +``#ifdef`` s”. + +* Plenty of issues are resolved by using ``six`` (or + ``modernize``, ``future``), so use them. If I did it again, + I would probably use ``future`` (and wrote py3k code), but the + difference is slim. + +* Do not hesitate to create your own shims. So I have for + example, ``bix_to_hex`` and ``oct_to_num`` or padding functions + there. + +* http://python-future.org/compatible_idioms.html + +.. class:: handout + + Whoever does not understand LISP, is doomed to reinvent it. + Badly. LISP -> six -- cgit