avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r1087473 - in /avro/branches/branch-1.5: ./ CHANGES.txt lang/py/src/avro/schema.py lang/py/test/av_bench.py
Date Thu, 31 Mar 2011 22:50:59 GMT
Author: cutting
Date: Thu Mar 31 22:50:58 2011
New Revision: 1087473

URL: http://svn.apache.org/viewvc?rev=1087473&view=rev
Log:
Merge -c 1087472 from trunk to 1.5 branch.  Fixes: AVRO-709.

Added:
    avro/branches/branch-1.5/lang/py/test/av_bench.py
      - copied unchanged from r1087472, avro/trunk/lang/py/test/av_bench.py
Modified:
    avro/branches/branch-1.5/   (props changed)
    avro/branches/branch-1.5/CHANGES.txt
    avro/branches/branch-1.5/lang/py/src/avro/schema.py

Propchange: avro/branches/branch-1.5/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 31 22:50:58 2011
@@ -1 +1 @@
-/avro/trunk:1075938,1075993,1078917,1079055,1079060,1079063,1083246,1085921,1086727,1086730,1086866,1087076,1087129,1087136,1087439-1087440,1087463
+/avro/trunk:1075938,1075993,1078917,1079055,1079060,1079063,1083246,1085921,1086727,1086730,1086866,1087076,1087129,1087136,1087439-1087440,1087463,1087472

Modified: avro/branches/branch-1.5/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.5/CHANGES.txt?rev=1087473&r1=1087472&r2=1087473&view=diff
==============================================================================
--- avro/branches/branch-1.5/CHANGES.txt (original)
+++ avro/branches/branch-1.5/CHANGES.txt Thu Mar 31 22:50:58 2011
@@ -23,6 +23,8 @@ Avro 1.5.1 (unreleased)
     AVRO-296. IDL: Use double-asterisk comments for schema documentation.
     (cutting)
 
+    AVRO-709. Python: Optimize property lookup. (Justin Azoff via cutting)
+
   BUG FIXES
 
     AVRO-786. Java: Fix equals() to work on objects containing maps. (cutting)

Modified: avro/branches/branch-1.5/lang/py/src/avro/schema.py
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.5/lang/py/src/avro/schema.py?rev=1087473&r1=1087472&r2=1087473&view=diff
==============================================================================
--- avro/branches/branch-1.5/lang/py/src/avro/schema.py (original)
+++ avro/branches/branch-1.5/lang/py/src/avro/schema.py Thu Mar 31 22:50:58 2011
@@ -113,18 +113,18 @@ class Schema(object):
     # add members
     if not hasattr(self, '_props'): self._props = {}
     self.set_prop('type', type)
+    self.type = type
 
   # Read-only properties dict. Printing schemas
   # creates JSON properties directly from this dict. 
   props = property(lambda self: self._props)
-  type = property(lambda self: self.get_prop('type'))
 
   # utility functions to manipulate properties dict
   def get_prop(self, key):
-    return self.props.get(key)
+    return self._props.get(key)
 
   def set_prop(self, key, value):
-    self.props[key] = value
+    self._props[key] = value
 
   def __str__(self):
     names = Names()
@@ -310,13 +310,13 @@ class Field(object):
         raise SchemaParseException(fail_msg)
     self.set_prop('type', type_schema)
     self.set_prop('name', name)
+    self.type = type_schema
+    self.name = name
     # TODO(hammer): check to ensure default is valid
     if has_default: self.set_prop('default', default)
     if order is not None: self.set_prop('order', order)
 
   # read-only properties
-  type = property(lambda self: self.get_prop('type'))
-  name = property(lambda self: self.get_prop('name'))
   default = property(lambda self: self.get_prop('default'))
   has_default = property(lambda self: self._has_default)
   order = property(lambda self: self.get_prop('order'))
@@ -324,9 +324,9 @@ class Field(object):
 
   # utility functions to manipulate properties dict
   def get_prop(self, key):
-    return self.props.get(key)
+    return self._props.get(key)
   def set_prop(self, key, value):
-    self.props[key] = value
+    self._props[key] = value
 
   def to_json(self, names):
     to_dump = self.props.copy()



Mime
View raw message