h2non / paco

Small utility library for coroutine-driven asynchronous generic programming in Python
http://paco.rtfd.io
MIT License
202 stars 13 forks source link

Documentation examples improvements #27

Closed Gr1N closed 7 years ago

Gr1N commented 7 years ago

Hi,

Some my ideas and improvements for examples in docstrings.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 96.513% when pulling 68cc2da42b7c9475a36eb608f9aa8fa87005fddb on Gr1N:fixup_examples into d7ac47ae27a471e41a135b719cf44863a705e488 on h2non:master.

Gr1N commented 7 years ago

Linter issues fixed.

About doctest, I can try to rewrite all examples in doctest style, but as I understand there some limitations, e.g. we can't use await syntax.

Some example according to doctest format:

>>> async def mul_2(num):
...     return num * 2
...
>>> paco.run(paco.map(mul_2, [1, 2, 3, 4, 5]))
[2, 4, 6, 8, 10]
h2non commented 7 years ago

Yes, that would be a bit tricky... I think we can consider that in another PR / enhancement iteration.

Is it fine for you if I proceed with the merge?

h2non commented 7 years ago

You can also create a new section in the README called Contributors and add there yourself :)

Gr1N commented 7 years ago

Is it fine for you if I proceed with the merge?

Yes, if PR looks good for you.

You can also create a new section in the README called Contributors and add there yourself :)

Thanks, but I think if anyone want to see list of contributors he can just run:

% git log --format='%aN' | sort -u

:)

tomas-fp commented 7 years ago

re contributors, in that case I'd prefer using git-extras instead: https://github.com/tj/git-extras/blob/master/Commands.md#git-summary