Concatenate two objects of the same type
Project description
concatenate
Concatenate two objects of the same type
Installation
pip install concatenate
Usage
>>> from concatenate import concatenate
>>>
>>> # int
>>> assert concatenate(123, 456) == 123456
>>> assert concatenate(0xdead, 0xbeef, base=16) == 0xdeadbeef
>>> assert concatenate(0b1010, 0b1100, base=2) == 0b10101100
>>> assert concatenate(0o137, 0o246, base=8) == 0o137246
>>>
>>> # str
>>> assert concatenate('foo', 'bar') == 'foobar'
>>>
>>> # dict
>>> assert concatenate({'a': 1}, {'b': 2}) == {'a': 1, 'b': 2}
>>>
>>> # list
>>> assert concatenate([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]
>>>
>>> # tuple
>>> assert concatenate((1, 2, 3), (4, 5, 6)) == (1, 2, 3, 4, 5, 6)
>>>
>>> # set
>>> assert concatenate({1, 2, 3}, {3, 4, 5}) == {1, 2, 3, 4, 5}
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
concatenate-0.1.2.tar.gz
(2.6 kB
view details)
Built Distribution
File details
Details for the file concatenate-0.1.2.tar.gz
.
File metadata
- Download URL: concatenate-0.1.2.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.9.9 Linux/5.10.83-1-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c42415c680cd67e611369701145b05ee06b1935b3ebe32f4cc66b9bed943096 |
|
MD5 | c1c75c1fe97f43f2577c0f2fe33c96c2 |
|
BLAKE2b-256 | a4809cc4434057ec54a3836d0c930a1a7c73b2e6ef9d74b1bc826133d807275a |
File details
Details for the file concatenate-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: concatenate-0.1.2-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.9.9 Linux/5.10.83-1-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a3b10a087c131249db7dea1ce249e71c963a38dfe4ebe23e242ab9d7a412754 |
|
MD5 | 42684434c1794b5d55eec1cbc57e7adb |
|
BLAKE2b-256 | b557bb710e5afe687c01cf029b3f0c9aa1eb2842b0633ba2afa9f058bacd6be7 |