Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added add method to tuple attr type

  • Loading branch information...
commit ae5bbe964177454b11219089b86dde5b73af948c 1 parent 5aecb5a
Tim Parkin authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 schemaish/attr.py
View
11 schemaish/attr.py
@@ -217,6 +217,17 @@ def __init__(self, attrs=None, **k):
if attrs is not None:
self.attrs = attrs
+ def add(self, attr):
+ """
+ Add an attribute to the tuple
+
+ @param attr: Attribute type.
+ """
+ if attr is None:
+ self.attrs = [attr]
+ else:
+ self.attrs.append(attr)
+
def validate(self, value):
"""
Validate the tuple's items and the tuple itself.
Please sign in to comment.
Something went wrong with that request. Please try again.