No project description provided
Project description
Jsmaps:
Starting with Js maps
- Creating a map:
jsmap = map_({'hi':'hello', 'wave':'hi'})
- Basic showcase:
from jsmaps import m #placeholder for map_ jsmap = m({'hi':'hello', 'wave':'hi', 0:'zero'}) print(jsmap) #{ # [0] [hi: hello] # [1] [wave: hi] # [2] [0: zero] #}print(jsmap[1]) #hi print(jsmap['hi']) #hello print(jsmap.get(0)) #zero print(jsmap.pair(0)) #{'hi':'hello'} print(jsmap.getpair(0)) #{2: 'zero'} 2 is the index in the map and zero is the value jsmap[0] = 'bye' #hi will now be bye jsmap['wave'] = 'hand' #wave will now be hand
Jsmaps Docs:
.get(self, value):
Like jsmap[value]
expect the value
is always treated as a dict key.
.pair(self, value, *, type=dict):
Returns the not specifed pair as a dict or list.
For example:
#map has [1] [hi: hello]
.pair(1) #{'hi':'hello'}
.pair('hi') #{1:'hello'}
.pair(1, type=list) ##['hi','hello']
.getpair(self, value, *, type=dict):
returns the index and value of a key as a dict or list.
#map has [2] [0: zero]
.getpair(0) #{2: 'zero'}
Tuple sets(beta)
Warning! beta. not completed.
Goal:
jsmap[key, slot] = value
jsmap[1, 1] = 'hi' #[1] ['hello':'hi'] is now [1] ['hi':'hi']
jsmap[1, 2] = 'hi' #[1] ['hi':'hello'] is now [1] ['hi':'hi']
jsmap[1, None] = {'hi': 'hi'} #[1] ['hello':'hello'] is now [1] ['hi':'hi']
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jsmaps-0.1.2.tar.gz
(2.7 kB
view details)
Built Distribution
File details
Details for the file jsmaps-0.1.2.tar.gz
.
File metadata
- Download URL: jsmaps-0.1.2.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.8.12 Linux/5.13.0-1027-gcp
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 355986dfbb3107af21dddaea8a30f91600cd87cd413c8b399178c9fb65bb6366 |
|
MD5 | f0a387f40204233538573080643710d3 |
|
BLAKE2b-256 | 01efa8243284d86777baf2f5e58697f66a0fbab05f545e37d09fdf3a1153a3cc |
File details
Details for the file jsmaps-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: jsmaps-0.1.2-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.8.12 Linux/5.13.0-1027-gcp
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dcff698cd2f735f1e32c8ca147b937e08639bb2ccb600925335d8bf860a45ad |
|
MD5 | 3dc1237eefa5d524917772f0dde73d63 |
|
BLAKE2b-256 | 263964537abe4ab5efeff29d308fe9873701c69b2817b751ff9de447ac6e189b |