Design thought for callbacks

Marko Rauhamaa marko at pacujo.net
Sun Feb 22 16:34:30 EST 2015


Cem Karan <cfkaran2 at gmail.com>:

> My goal is to make things as pythonic (whatever that means in this
> case) and obvious as possible. Ideally, a novice can more or less
> guess what will happen with my API without really having to read the
> documentation on it.

If you try to shield your user from the complexities of asynchronous
programming, you will only cause confusion. You will definitely need to
document all nooks and crannies of the semantics of the callback API and
your user will have to pay attention to every detail of your spec.

Your user, whether novice or an expert, will thank you for your
unambiguous specification even if it is complicated.


Marko



More information about the Python-list mailing list