Skip to content

Commit 0ff1118

Browse files
committed
Merge branch 'tlz2' into tlz
oops, I pushed the wrong thing to github.
2 parents 05f2312 + 05ede53 commit 0ff1118

File tree

14 files changed

+93
-66
lines changed

14 files changed

+93
-66
lines changed

AUTHORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ Joe Jevnik [@llllllllll](https://github.com
2929
Rory Kirchner [@roryk](https://github.com/roryk)
3030

3131
[Steven Cutting](http://steven-cutting.github.io) [@steven_cutting](https://github.com/steven-cutting)
32+
33+
Aric Coady [@coady](https://github.com/coady)

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
include LICENSE.txt
2+
13
include toolz/tests/*.py

README.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Toolz
55

66
A set of utility functions for iterators, functions, and dictionaries.
77

8-
See the PyToolz documentation at http://toolz.readthedocs.org
8+
See the PyToolz documentation at https://toolz.readthedocs.io
99

1010
LICENSE
1111
-------
@@ -21,12 +21,6 @@ Install
2121

2222
pip install toolz
2323

24-
or
25-
26-
::
27-
28-
easy_install toolz
29-
3024
Structure and Heritage
3125
----------------------
3226

@@ -54,7 +48,7 @@ These functions come from the legacy of functional languages for list
5448
processing. They interoperate well to accomplish common complex tasks.
5549

5650
Read our `API
57-
Documentation <http://toolz.readthedocs.org/en/latest/api.html>`__ for
51+
Documentation <https://toolz.readthedocs.io/en/latest/api.html>`__ for
5852
more details.
5953

6054
Example

conda.recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ test:
2222
- py.test -x --doctest-modules --pyargs toolz
2323

2424
about:
25-
home: http://toolz.readthedocs.org/
25+
home: https://toolz.readthedocs.io/
2626
license: BSD

doc/source/control.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ need for simultaneous thought is restricted to only a few elements at a time.
88

99
All modern languages provide mechanisms to build data into data structures and
1010
to build functions out of other functions. The third element of programming,
11-
besides data and functions is control flow. Control flow is the third
12-
element of programming, after data and functions. Building complex control
13-
flow out of simple control flow presents deeper challenges.
11+
besides data and functions, is control flow. Building complex control flow
12+
out of simple control flow presents deeper challenges.
1413

1514

1615
What?

doc/source/streaming-analytics.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ These functions correspond to the SQL commands ``SELECT`` and ``WHERE``.
3434
.. code::
3535
3636
>>> from toolz.curried import pipe, map, filter, get
37-
>>> pipe(accounts, filter(lambda (id, name, balance, gender): balance > 150),
37+
>>> pipe(accounts, filter(lambda acc: acc[2] > 150),
3838
... map(get([1, 2])),
3939
... list)
4040
@@ -150,9 +150,9 @@ that adds up the balances for each group:
150150

151151
.. code::
152152
153-
>>> binop = lambda total, (id, name, bal, gend): total + bal
153+
>>> binop = lambda total, account: total + account[2]
154154
155-
>>> reduceby(get(3), binop, accounts)
155+
>>> reduceby(get(3), binop, accounts, 0)
156156
{'F': 400, 'M': 400}
157157
158158
@@ -307,9 +307,9 @@ composition, ...) users interested in data analytics might be better served by
307307
using projects specific to data analytics like Pandas_ or SQLAlchemy.
308308

309309

310-
.. _groupby: http://toolz.readthedocs.org/en/latest/api.html#toolz.itertoolz.groupby
311-
.. _join: http://toolz.readthedocs.org/en/latest/api.html#toolz.itertoolz.join
312-
.. _reduceby: http://toolz.readthedocs.org/en/latest/api.html#toolz.itertoolz.reduceby
313-
.. _valmap: http://toolz.readthedocs.org/en/latest/api.html#toolz.itertoolz.valmap
310+
.. _groupby: https://toolz.readthedocs.io/en/latest/api.html#toolz.itertoolz.groupby
311+
.. _join: https://toolz.readthedocs.io/en/latest/api.html#toolz.itertoolz.join
312+
.. _reduceby: https://toolz.readthedocs.io/en/latest/api.html#toolz.itertoolz.reduceby
313+
.. _valmap: https://toolz.readthedocs.io/en/latest/api.html#toolz.dicttoolz.valmap
314314
.. _Pandas: http://pandas.pydata.org/pandas-docs/stable/groupby.html
315-
.. _curried: http://toolz.readthedocs.org/en/latest/curry.html
315+
.. _curried: https://toolz.readthedocs.io/en/latest/curry.html

setup.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,16 @@
2020
package_data={'toolz': ['tests/*.py']},
2121
long_description=(open('README.rst').read() if exists('README.rst')
2222
else ''),
23-
zip_safe=False)
23+
zip_safe=False,
24+
classifiers=[
25+
"Development Status :: 5 - Production/Stable",
26+
"License :: OSI Approved :: BSD License",
27+
"Programming Language :: Python",
28+
"Programming Language :: Python :: 2.6",
29+
"Programming Language :: Python :: 2.7",
30+
"Programming Language :: Python :: 3",
31+
"Programming Language :: Python :: 3.3",
32+
"Programming Language :: Python :: 3.4",
33+
"Programming Language :: Python :: 3.5",
34+
"Programming Language :: Python :: Implementation :: CPython",
35+
"Programming Language :: Python :: Implementation :: PyPy"])

tlz/_build_tlz.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import sys
22
import types
3-
#try:
4-
# from importlib import import_module
5-
#except ImportError:
6-
# raise ImportError('"tlz" package is not available in Python 2.6')
73
import toolz
84
from toolz.compatibility import import_module
95

6+
107
class TlzLoader(object):
118
""" Finds and loads ``tlz`` modules when added to sys.meta_path"""
129
def __init__(self):

toolz/_signatures.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import itertools
1818
import operator
1919

20-
from .compatibility import PY3
20+
from .compatibility import PY3, import_module
2121
from .functoolz import (is_partial_args, is_arity, has_varargs,
2222
has_keywords, num_required_args)
2323

@@ -706,10 +706,7 @@ def expand_sig(sig):
706706
def create_signature_registry(module_info=module_info, signatures=signatures):
707707
for module, info in module_info.items():
708708
if isinstance(module, str):
709-
modnames = module.split('.')
710-
module = __import__(module)
711-
for attr in modnames[1:]:
712-
module = getattr(module, attr)
709+
module = import_module(module)
713710
for name, sigs in info.items():
714711
if hasattr(module, name):
715712
new_sigs = tuple(expand_sig(sig) for sig in sigs)

toolz/compatibility.py

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

88
__all__ = ('map', 'filter', 'range', 'zip', 'reduce', 'zip_longest',
99
'iteritems', 'iterkeys', 'itervalues', 'filterfalse',
10-
'PY3', 'PY34', 'PYPY')
10+
'PY3', 'PY34', 'PYPY', 'import_module')
1111

1212
if PY3:
1313
map = map

0 commit comments

Comments
 (0)