Permalink
Browse files

Changed all sentences with occurrences of subscribing to a similar se…

…ntence that uses the word "subscript". And the person that comes up with a less confusing verb for the attribute/item lookup method (that is not lookup!!1) gets an extra THANKS entry.

--HG--
branch : trunk
  • Loading branch information...
1 parent 4778bda commit b93887731dae33b537069d88aed4dadf7d83c818 @mitsuhiko mitsuhiko committed Jun 25, 2008
Showing with 10 additions and 11 deletions.
  1. +4 −5 docs/templates.rst
  2. +1 −1 jinja2/compiler.py
  3. +5 −5 jinja2/nodes.py
View
@@ -59,7 +59,7 @@ too. How a variable looks like, heavily depends on the application providing
those.
You can use a dot (``.``) to access attributes of a variable, alternative the
-so-called "subscribe" syntax (``[]``) can be used. The following lines do
+so-called "subscript" syntax (``[]``) can be used. The following lines do
the same::
{{ foo.bar }}
@@ -74,13 +74,12 @@ value. What you can do with that kind of value depends on the application
configuration, the default behavior is that it evaluates to an empty string
if printed and that you can iterate over it, but every other operation fails.
-.. _notes-on-subscribing:
+.. _notes-on-subscriptions:
.. admonition:: Implementation
- The process of looking up attributes and items of objects is called
- "subscribing" an object. For convenience sake ``foo.bar`` in Jinja2
- does the following things on the Python layer:
+ For convenience sake ``foo.bar`` in Jinja2 does the following things on
+ the Python layer:
- check if there is an attribute called `bar` on `foo`.
- if there is not, check if there is an item ``'bar'`` in `foo`.
View
@@ -1274,7 +1274,7 @@ def visit_Getattr(self, node, frame):
self.write(', %r)' % node.attr)
def visit_Getitem(self, node, frame):
- # slices or integer subscriptions bypass the subscribe
+ # slices or integer subscriptions bypass the getitem
# method if we can determine that at compile time.
if isinstance(node.arg, nodes.Slice) or \
(isinstance(node.arg, nodes.Const) and
View
@@ -316,7 +316,7 @@ class FromImport(Stmt):
"""A node that represents the from import tag. It's important to not
pass unsafe names to the name attribute. The compiler translates the
attribute lookups directly into getattr calls and does *not* use the
- subscribe callback of the interface. As exported variables may not
+ subscript callback of the interface. As exported variables may not
start with double underscores (which the parser asserts) this is not a
problem for regular Jinja code, but if this node is used in an extension
extra care must be taken.
@@ -583,9 +583,7 @@ def as_const(self):
class Getitem(Expr):
- """Subscribe an expression by an argument. This node performs a dict
- and an attribute lookup on the object whatever succeeds.
- """
+ """Get an attribute or item from an expression and prefer the item."""
fields = ('node', 'arg', 'ctx')
def as_const(self):
@@ -602,7 +600,9 @@ def can_assign(self):
class Getattr(Expr):
- """Subscribe an attribute."""
+ """Get an attribute or item from an expression that is a ascii-only
+ bytestring and prefer the attribute.
+ """
fields = ('node', 'attr', 'ctx')
def as_const(self):

0 comments on commit b938877

Please sign in to comment.