Skip to main content

scala collection like interface for python iterato.r

Iterable object:

>>> from scalalike.collections import Iterable
>>> it = Iterable(range(10))
>>> it
<scalalike.collections.collection.Iterable object at 0x9b0428c>
>>> it.to_list()
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> it.map(lambda x:x*2).to_list()
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
>>> it.filter(lambda x:x%2 == 0).to_list()
[0, 2, 4, 6, 8]
>>> it.filter(lambda x:x%2 == 0).map(lambda x:x*2).to_list()
[0, 4, 8, 12, 16]
>>> it.flatmap(lambda x: [x, x]).to_list()
[0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9]
>>> it.take(4).to_list()
[0, 1, 2, 3]
>>> it.foldleft(lambda x, y: x+y)
45

Map object:

>>> from scalalike.collections import Iterable
>>> mp = Map(aa=10, bb=20)
>>> mp
{'aa': 10, 'bb': 20}
>>> mp.map(lambda (k, v): (k, v*2))
{'aa': 20, 'bb': 40}
>>> mp.filter(lambda (k, v): k == 'bb')
{'bb': 20}

Metadata

Release files for scalalike.collections 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scalalike.collections 0.1.0
File Size Uploaded Provenance Actions
scalalike.collections-0.1.0.tar.gz 3.2 kB Without provenance Details for scalalike.collections-0.1.0.tar.gz

Release files / scalalike.collections-0.1.0.tar.gz

Download URL scalalike.collections-0.1.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ebdc2a6ee4242fc2bc5f2909b8531b4b60eb61c71ce9bde2b8ca2d035f5f39fc
BLAKE2b-256 checksum
How to use checksums
1dea06c4ca5ce569523d074cae4e4979d4d1f6e0619713895528a595594effd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for scalalike.collections 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page