Skip to content

zackmdavis/pyrst_collections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

What happens if I try to expose Rust's collections types in Python?

$ python3
Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyrst_collections import SortedStringCounter
hello Rust—Python simple FFI world
>>> c = SortedStringCounter()
>>> for count, item in enumerate(("foo", "bar", "quux", "rah"), start=1):
...     for _ in range(count):
...         c.increment(item)
... 
>>> c
SortedStringCounter({"bar": 2, "foo": 1, "quux": 3, "rah": 4})

"pyrst" is pronounced like "pierced."

Bibliography

About

an exercise in Rust-Python FFI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published