Skip to main content

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


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)

Uploaded Source

Built Distribution

concatenate-0.1.1-py3-none-any.whl (2.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page