Implements various Python functions and methods for use in Node
- range([start], stop, [step])
Function to imitate Python's range function Returns an Array that produces a sequence of integers from start (inclusive) to stop (exclusive) by step.
- len(thing) ⇒ `number`
Function to imitate Python's len() function. Wrapper function around the
.length
property- partition(string, sep) ⇒ `array`
Function to imitate Python's `str.partition()` method, since JavaScript can't split x times
- split(string, sep, [maxCount]) ⇒ `array`
Function to imitate Python's `str.split()` method, since JavaScript can't split x times
- chunks(l, n)
Yield successive n-sized chunks from l.
Class to imitate Python str
Kind: global class
Param | Type |
---|---|
string | string |
str.partition() ⇐ partition
Kind: instance method of str
Extends: partition
str.split() ⇐ split
Kind: instance method of str
Extends: split
Class to imitate Python dicts
Kind: global class
- dict
- new dict(value)
- .items() ⇒
array
- .clear()
- .get(key, [def]) ⇒
object
|array
|string
|function
|boolean
|number
- .pop(key, [def]) ⇒
*
- .setdefault(key, [def]) ⇒
*
- .keys() ⇒
array
- .update(other)
- .values() ⇒
array
Param | Type | Description |
---|---|---|
value | object |
The native JavaScript object you wish to |
Kind: instance method of dict
Kind: instance method of dict
Kind: instance method of dict
Param | Type | Default |
---|---|---|
key | string |
|
[def] | * |
|
Kind: instance method of dict
Param | Type | Default |
---|---|---|
key | string |
|
[def] | * |
|
Kind: instance method of dict
Param | Type | Default |
---|---|---|
key | string |
|
[def] | * |
|
Kind: instance method of dict
Kind: instance method of dict
Param | Type |
---|---|
other | object |
Kind: instance method of dict
Function to imitate Python's range function Returns an Array that produces a sequence of integers from start (inclusive) to stop (exclusive) by step.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
[start] | number |
The starting number. Defaults to 0. | |
stop | number |
The end number. | |
[step] | number |
1 |
Specifies the increment (or decrement). Defaults to 1. |
Function to imitate Python's len()
function.
Wrapper function around the .length
property.
Kind: global function
Param | Type |
---|---|
thing | * |
Function to imitate Python's str.split()
method, since JavaScript can't split x times
Kind: global function
Returns: array
- An Array containing the split string
Param | Type | Description |
---|---|---|
string | string |
The string you want split. |
sep | string |
The seperator by which you want the string to be split |
Function to imitate Python's str.split method, since JavaScript can't split x times
Kind: global function
Returns: array
- An Array containing the split string
Param | Type | Default | Description |
---|---|---|---|
string | string |
The string you want split. | |
sep | string |
The seperator by which you want the string to be split | |
[maxCount] | number |
|
The maximum count of times you wish to split |
Yield successive n-sized chunks from l.
Kind: global function
Param | Type |
---|---|
l | array |
n | number |