blob: 9835262515bc4967506c59982dffb1681cf4f960 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
Trollius is an experimental port of the Tulip project (asyncio module, PEP
3156) on Python 2.7.
* Website: https://bitbucket.org/haypo/trollius
* Tulip project: http://code.google.com/p/tulip/
* Copyright/license: Open source, Apache 2.0. Enjoy.
Dependencies
============
The futures project is needed on Python 2 to get a backport of
concurrent.futures.
https://pypi.python.org/pypi/futures
The concurrent.futures is optional, it is only required when
BaseEventLoop.run_in_executor() is used. This method is used by
BaseEventLoop.getaddrinfo() and BaseEventLoop.getnameinfo().
Unit tests require the mock module:
https://pypi.python.org/pypi/mock
Differences between Trollius and Tulip
======================================
* Python 2 has no keyword-only parameters
* Trollius coroutines use yield whereas Tulip coroutines must use yield-from
* Trollius coroutines must use "raise Return(value)", whereas Tulip simply
uses "return value" thanks to Python 3.3 improvments
* If the concurrent.futures module is missing, BaseEventLoop.run_in_executor()
raises NotImplementedError and asyncio.wrap_future() is not available
Usage
=====
The actual code lives in the 'asyncio' subdirectory.
Tests are in the 'tests' subdirectory.
To run tests:
- make test
To run coverage (coverage package is required):
- make coverage
On Windows, things are a little more complicated. Assume 'P' is your
Python binary (for example C:\Python33\python.exe).
You must first build the _overlapped.pyd extension and have it placed
in the asyncio directory, as follows:
C> P setup.py build_ext --inplace
Then you can run the tests as follows:
C> P runtests.py
And coverage as follows:
C> P runtests.py --coverage
--Guido van Rossum <guido@python.org>
Trollius name
=============
Extract of http://en.wikipedia.org/wiki/Trollius :
Trollius is a genus of about 30 species of plants in the family Ranunculaceae,
closely related to Ranunculus. The common name of some species is globeflower
or globe flower. Native to the cool temperate regions of the Northern
Hemisphere, with the greatest diversity of species in Asia, trollius usually
grow in heavy, wet clay soils.
Change log
==========
Development version
- Fix asyncio.time_monotonic on Mac OS X
2014-01-04: version 0.1
- First public release
|