On Wednesday, May 14, 2014 4:12:41 PM UTC+1, Nathann Cohen wrote:
>
> @cached_function 
>
def is_construction_possible(n): 
>     if whatever: 
>         return  actual_construction #just the  function


No, you haven't read what I wrote. In English, "is possible" asks for a 
boolean outcome, so is_possible() shall return a boolean.

Here is again what I originally wrote, maybe you'll read it this time:

def work_for_case_1():
    return long_computation_1()

def work_for_case_2():
    return long_computation_2()

def _select_case():
    if case1:
      return work_for_case_1
    elif case2:
      return work_for_case_2
    else:
       raise NotImplementedError

def orthogonal_array():
    return _select_case()()

def is_constructible():
    try:
        _select_case()
       return True
    except NotImplementedError:
        return False

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to