Skip to main content
Help us improve Python packaging – donate today!

A pure-python list shifter/wrapper

Project Description

A pure-python list-shifter/wrapper. Shifts/Wraps an iterable left or right by any amount (modulo to the length of iterable). Can optionally shift the iterable in-place. Create a shifty instance to add these convenience methods to the default list implementation if you prefer.

Why slice when you can shift ‘like-a-boss’ ?!

Codeship Status Build Status Downloads Latest Version Supported Python versions Development Status Wheel Status Egg Status Download format License

How do I get set up?

  • python setup.py install
  • Dependencies: six
  • Dependencies (test): Coverage, nose
  • How to run tests: ./runtests.sh
  • Deployment instructions: pip install shifty

Contribution guidelines

I accept pull requests.

What about test coverage?

There is a full suite of unit-tests.

Who do I talk to?

  • Francis Horsman: francis.horsman@gmail.com

Example

>>> from shifty import shift_left, shifty

>>> a = [1, 2, 3, 4]
>>> b = shift_left(a, 3)
>>> b
[4, 1, 2, 3]
>>> assert a is not b

>>> b = shift_left(a, 2, in_place=True)

>> assert a is b

>>> b = shift_left(a, 5)

>>> b
[4, 1, 2, 3]

Release history Release notifications

This version
History Node

1.0.8

History Node

1.0.7

History Node

1.0.1

History Node

1.0.0

History Node

0.0.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
shifty-1.0.8-py2.py3-none-any.whl (12.9 kB) Copy SHA256 hash SHA256 Wheel 2.7 Mar 18, 2015
shifty-1.0.8.tar.gz (10.6 kB) Copy SHA256 hash SHA256 Source None Mar 18, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page