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.1.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for concatenate-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5950d1b15e22add7412df568e64cbbcea5bc36877d509c7401478854cc9dea5d |
|
MD5 | e525c1a0112ca09cac169ff11b1f3928 |
|
BLAKE2b-256 | f558456b3c8f2b4ab91c49baee8e05d83d71725b383be236dfc72224cdf417a1 |