Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FIX: typos, and more README

  • Loading branch information...
commit c318990101db703189c80028363bd4cf47435d47 1 parent 9a5b34b
@serkanyersen authored
Showing with 15 additions and 12 deletions.
  1. +14 −8 README.md
  2. +1 −4 src/underscore.py
View
22 README.md
@@ -10,10 +10,12 @@
Underscore.py is a python port of excellent javascript library underscore.js
-**From underscore page:**
+**What is underscore.js?**
- Underscore.js is a utility-belt library for JavaScript that provides support for the usual functional
- suspects (each, map, reduce, filter...) without extending any core JavaScript objects.
+ From underscore page: Underscore.js is a utility-belt library for JavaScript that provides support for the
+ usual functional suspects (each, map, reduce, filter...) without extending any core JavaScript objects.
+
+NOTE: It's obvious that python already has nearly all features of underscore library built-in. I'm not trying to fill any gap in python. If you are coming from JavaScript this library will provide you a familiar interface, a set of tools you already know how to use and micro templating functionality. Use it wisely and try to use built-in functions wherever possible.
## Installing
Clone this repository:
@@ -35,6 +37,11 @@ Import underscore to your project
```python
from underscore import _
```
+or if you don't want to mess with _ variable
+```python
+from underscore import _ as us # You can use any name you want, __ or u
+```
+
## Use it just like javascript version
```python
# Dynamically
@@ -69,7 +76,6 @@ people = [{
for person in people:
print tmpl(person)
```
-
Output
Name: John
@@ -79,11 +85,11 @@ Output
Last Name: BROWN
E-mail: james@brown.net
-For more information [underscorejs.org](http://underscorejs.org)
+For more information and documentation [underscorejs.org](http://underscorejs.org)
-Source: [Underscore.js on Github](https://github.com/documentcloud/underscore)
+Original Source: [Underscore.js on Github](https://github.com/documentcloud/underscore)
### Disclaimer
-Please keep in mind that this is just a port of a javascript library, please don't get started with
+Please keep in mind that this is a direct port of a javascript library, so don't get started with
the "but it's not pythonic" stuff. This library has no intentions to be pythonic, infact it tries to
-bring same underscore experience from javascript to python
+bring the same underscore experience from javascript to python
View
5 src/underscore.py
@@ -66,9 +66,6 @@ class underscore():
"""
VERSION = "0.1.2"
- """
- Version of the library
- """
chained = False
"""
@@ -78,7 +75,7 @@ class underscore():
Null = "__Null__"
"""
Since we are working with the native types
- I cannot compare anything type with None, so I use a Substitute type for checking
+ I cannot compare anything with None, so I use a Substitute type for checking
"""
_wrapped = Null
Please sign in to comment.
Something went wrong with that request. Please try again.