https://github.com/hexlet-components/python-pairs
A SICP'ish Functional Pairs implemented in Python
https://github.com/hexlet-components/python-pairs
python3 sicp typed-python
Last synced: about 2 months ago
JSON representation
A SICP'ish Functional Pairs implemented in Python
- Host: GitHub
- URL: https://github.com/hexlet-components/python-pairs
- Owner: hexlet-components
- License: isc
- Created: 2019-07-23T16:13:16.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-12-09T09:32:50.000Z (4 months ago)
- Last Synced: 2025-12-27T09:30:43.977Z (3 months ago)
- Topics: python3, sicp, typed-python
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 8
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-pairs
[](https://github.com/hexlet-components/python-pairs/actions)
A SICP'ish Functional Pairs implemented in Python.
## Install
```shell
pip install hexlet-pairs
```
## Usage
from hexlet import pairs
p = pairs.cons(42, 'foo')
pairs.is_pair(p) # True
pairs.car(p) # 42
pairs.cdr(p) # 'foo'
print(pairs.to_string(p)) # cons(42, 'foo')
---
[](https://hexlet.io?utm_source=github&utm_medium=link&utm_campaign=python-pairs)
This repository is created and maintained by the team and the community of Hexlet, an educational project. [Read more about Hexlet](https://hexlet.io?utm_source=github&utm_medium=link&utm_campaign=python-pairs).
See most active contributors on [hexlet-friends](https://friends.hexlet.io/).