Syntax for new constraint?
Posted: Thu Jul 22, 2010 9:17 pm
Hi. Quick one. What's the syntax for declaring a new constraint?
- Code: Select all
def method<of T>
where T must be XXX
t = T() # error: Cannot create an instance of the variable
# type "T" because it doesn"t have the new() constraint
...