An open API service indexing awesome lists of open source software.

https://github.com/loopyme/life-is-short

Print "Life is short" using python's various features
https://github.com/loopyme/life-is-short

Last synced: 2 months ago
JSON representation

Print "Life is short" using python's various features

Awesome Lists containing this project

README

        

# Life-is-Short

[中文](./readme_zh.md)

> Based on Python3.8

Print "Life is short" using python's features.

This is a project for python learners, which aim is to demonstrate or practice some of Python's language features.

## Examples

|||||||||
|---|---|---|---|---|---|---|---|
|a|[format](./LifeIsShort/a/format_.py)|[list](./LifeIsShort/a/list_.py)|[if](./LifeIsShort/a/if_.py)|[print](./LifeIsShort/a/print_.py)|[set](./LifeIsShort/a/set_.py)|[sort](./LifeIsShort/a/sort_.py)|
|b|[list comprehension](./LifeIsShort/b/list_comprehension.py)|[Iteration](./LifeIsShort/b/Iteration.py)|[lambda](./LifeIsShort/b/lambda_.py)|[iterator](./LifeIsShort/b/iterator.py)|[recursion](./LifeIsShort/b/recursion.py)|[filter](./LifeIsShort/b/filter_.py)|[map](./LifeIsShort/b/map_.py)|
|c|[reduce](./LifeIsShort/c/reduce.py)|[generator](./LifeIsShort/c/generator.py)|[eval](./LifeIsShort/c/eval_.py)|[decorator with parameter](./LifeIsShort/c/decorator_with_parameter.py)|[decorator](./LifeIsShort/c/decorator.py)|[func as return](./LifeIsShort/c/func_as_return.py)|[partial func](./LifeIsShort/c/partial_func.py)|
|d|[contextor](./LifeIsShort/d/contextor.py)|[generator yield](./LifeIsShort/d/generator_yield.py)|[monkey patch](./LifeIsShort/d/monkey_patch.py)|[process pool](./LifeIsShort/d/process_pool.py)|[coroutines](./LifeIsShort/d/coroutines.py)|[duck type](./LifeIsShort/d/duck_type.py)|[coroutines async](./LifeIsShort/d/coroutines_async.py)|

Each of the examples above are:
- Able to print "Life is short"
- Using the specified Python feature
- Not using third-party packages
- As simple and readable as possible

## TODO
- [ ] Explain the examples
- [ ] Add examples for object-oriented programming
- [ ] Add some more examples
- [x] Add Unit test
- [ ] Add CI

## Contributing

Any form of contributing is welcomed.