[Python] Julia (Was: Walks like Python. Runs like C).

Marco Ippolito ippolito.marco a gmail.com
Ven 16 Gen 2015 07:46:58 CET


A settembre, elettrizzato dalla possibilità che si potesse lavorare
come in node anche in python in modalità asincrona, mi sono messo a
capire async-requests ed asyncio.
Risultato: non ho capito molto come funzionano, ma penso di aver
intuito che sono molto lontani dalla semplicità d'uso ed efficacia del
modello asincrono di node.js

ecco quanto mi ha scritto uno degli sviluppatori di asyncio:
"you don't have a full understanding of how asyncio functions, which
is understandable because asyncio is a nightmare of complexity. The
short statement is that asyncio uses an event loop, combined with
futures and coroutines (in the form of generators) to perform explicit
concurrency.

Note that it performs explicit concurrency. You cannot drop a random
library into an asyncio project and expect it to function correctly.
The project needs to have been written from the ground up to
understand asyncio, or at least to have been wrapped in asyncio
goodness. aiohttp has been written in exactly that manner: requests
has not. This means that requests never yields for other coroutines to
run, and so they never will. This totally eliminates the advantage of
asyncio.

There is no plan currently to rewrite requests to use asyncio: support
is simply not there yet.

If you would like to use something that looks like requests' API, you
have one obvious option.:async-requests, which has been written for
asyncio. I don't know, however, whether it is Python 3.4 only or not."




Il 15 gennaio 2015 21:22, Carlos Catucci <carlos.catucci a gmail.com> ha scritto:
>
> 2015-01-15 19:46 GMT+01:00 Giovanni Porcari <giovanni.porcari a softwell.it>:
>>
>> A me Javascript PIACE.
>>
>> Picchiatemi, lapidatemi e strozzatemi ma non lo trovo così
>> orrendo e usato lato client ci fai cose eccellenti.
>> (ovviamente se capisci che contiene insidie nascoste
>> per cui un campo minato al confronto è un luogo piacevole e rilassante).
>>
>> Usarlo come server... ehm Ma che vantaggio c'è ???
>
>
> Io uso js in frontend. Con jQuery sopra diventa abbastanza simile a Python
> da potermi quasi piacere, e poi usato a oggetti (si va beh) non e' cosi'
> malaccio. bella la cosa sul campo minato, sull'usarl sul server, beh hai il
> vaytaggio di avere un linguaggio in meno da usare (tra programmazione,
> descrizione di pagina etc spesso ci si trova a menggiare 4, 5 anche 6
> diversi bagagli) ma il discorso fila se lato server hai una chiavica come
> PHP oppure un mostro di complessita' come Java. Se usi un linguaggio morbido
> tutto decade.
>
> Carlos
> --
> EZLN ... Para Todos Todo ... Nada para nosotros
>
> _______________________________________________
> Python mailing list
> Python a lists.python.it
> http://lists.python.it/mailman/listinfo/python
>


Maggiori informazioni sulla lista Python