Skip to content

Commit 16b99ad

Browse files
committed
-
1 parent 8e43980 commit 16b99ad

File tree

10 files changed

+2870
-6
lines changed

10 files changed

+2870
-6
lines changed

source_py2/python_toolbox/caching/decorators.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import datetime as datetime_module
1212

13-
from python_toolbox import misc_tools
1413
from python_toolbox import binary_search
1514
from python_toolbox import decorator_tools
1615
from python_toolbox.sleek_reffing import SleekCallArgs
@@ -69,6 +68,8 @@ def f(a, b=2):
6968
# completely argumentless function. so do one for those.
7069

7170
from python_toolbox.nifty_collections import OrderedDict
71+
from python_toolbox import misc_tools
72+
7273

7374
if time_to_keep is not None:
7475
if max_size != infinity:

source_py2/python_toolbox/combi/perming/perm_space.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ def coerce(cls, argument):
159159
else:
160160
return cls(argument)
161161

162-
def __init__(self, iterable_or_length, n_elements=None, *, domain=None,
162+
@misc_tools.limit_positional_arguments(3)
163+
def __init__(self, iterable_or_length, n_elements=None, domain=None,
163164
fixed_map=None, degrees=None, is_combination=False,
164165
slice_=None, perm_type=None):
165166

@@ -948,7 +949,8 @@ def _coerce_perm(self, perm):
948949
prefix = None
949950

950951
@classmethod
951-
def _create_with_cut_prefix(cls, sequence, domain=None, *,
952+
@misc_tools.limit_positional_arguments(3)
953+
def _create_with_cut_prefix(cls, sequence, domain=None,
952954
n_elements=None, fixed_map=None, degrees=None, is_combination=False,
953955
slice_=None, perm_type=None, shit_set=frozenset()):
954956
'''

source_py2/python_toolbox/nifty_collections/abstract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import abc
55
import collections
6-
import queue
6+
import Queue as queue
77
import multiprocessing.queues
88

99

source_py2/python_toolbox/nifty_collections/weak_key_default_dict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# todo: revamp
1010

1111
import collections
12+
import UserDict
1213
from weakref import ref
1314

1415

source_py2/python_toolbox/string_tools/string_tools.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import sys
77
import re
88

9-
from python_toolbox import cute_iter_tools
10-
119

1210
def docstring_trim(docstring):
1311
'''Trim a docstring, removing redundant tabs.'''
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# -*- coding: utf-8 -*-
2+
3+
"""
4+
sortedcontainers Sorted Container Types Library
5+
===============================================
6+
7+
SortedContainers is an Apache2 licensed containers library, written in
8+
pure-Python, and fast as C-extensions.
9+
10+
Python's standard library is great until you need a sorted container type. Many
11+
will attest that you can get really far without one, but the moment you
12+
**really need** a sorted list, dict, or set, you're faced with a dozen
13+
different implementations, most using C-extensions without great documentation
14+
and benchmarking.
15+
16+
Things shouldn't be this way. Not in Python.
17+
18+
::
19+
20+
>>> from sortedcontainers import SortedList, SortedDict, SortedSet
21+
>>> sl = SortedList(xrange(10000000))
22+
>>> 1234567 in sl
23+
True
24+
>>> sl[7654321]
25+
7654321
26+
>>> sl.add(1234567)
27+
>>> sl.count(1234567)
28+
2
29+
>>> sl *= 3
30+
>>> len(sl)
31+
30000003
32+
33+
SortedContainers takes all of the work out of Python sorted types - making your
34+
deployment and use of Python easy. There's no need to install a C compiler or
35+
pre-build and distribute custom extensions. Performance is a feature and
36+
testing has 100% coverage with unit tests and hours of stress.
37+
38+
:copyright: (c) 2014 by Grant Jenks.
39+
:license: Apache 2.0, see LICENSE for more details.
40+
41+
"""
42+
43+
__title__ = 'sortedcontainers'
44+
__version__ = '0.9.1'
45+
__build__ = 0x000901
46+
__author__ = 'Grant Jenks'
47+
__license__ = 'Apache 2.0'
48+
__copyright__ = 'Copyright 2014 Grant Jenks'
49+
50+
from .sortedlist import SortedList
51+
from .sortedset import SortedSet
52+
from .sorteddict import SortedDict
53+
from .sortedlistwithkey import SortedListWithKey
54+
55+
__all__ = [SortedList, SortedSet, SortedDict, SortedListWithKey]

0 commit comments

Comments
 (0)