underscore.py icon indicating copy to clipboard operation
underscore.py copied to clipboard

Python port of underscore.js

Results 13 underscore.py issues
Sort by recently updated
recently updated
newest added

There is a small typo in src/underscore.py. Should read `property` rather than `propert`. Semi-automated pull request generated by https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md

intersection doesn't seem to perform correctly. Intersecting a simple list of strings results in []. Simple fix was to remove the first 4 lines where there's a test for 'int',...

Added two methods to find the index / indices for the min and max value of a list respectively. Added a couple of unit tests too. Please let me know...

With underscore.py: ``` _.groupBy(['one'], lambda x, l: len(x)) # --> ['one'] ``` With underscore.js: ``` _.groupBy(['one'], 'length') // --> {3: ["one"]} ```

Hi, I followed the directions in your README.md and ran `pip install underscore.py.` But when I built scripts written by my co-workers, I received errors that said `function object does...

Your library seem great. But I think compare with [http://underscorejs.org/](http://underscorejs.org/), it's lack of fully documentation. Can you add it in the future?

``` >>> from underscore import _ as _underscore >>> filter_fields = ['id', 'keyword'] >>> test_fields = [u'id', 'keyword', 'other'] >>> len(_underscore.without(test_fields, *filter_fields)) 2 >>> len(_underscore.difference(test_fields, filter_fields) 1 ``` Difference is...

Bug

The current tests for _.where() only test with a single key:value pair to filter by. I'm seeing behavior that looks like the function does not work properly if there are...

``` python File "test.py", line 27, in action _(chapters.items()).forEach(lambda item, *others: File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/underscore.py-0.1.6-py3.4.egg/underscore/underscore.py", line 174, in each TypeError: 'ItemsView' object is not subscriptable ``` `chapters` is an OrderedDict.

Bug