> 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:
Oh. Well it does work, but if I need to introduce a specific wrapper function to be called by the user before the "actual" code I think I would use Nils' trick. If only to not forget it, because it is cool ! On the other hand the best for me would be that you would all come to your senses and accept the idea that filtering what you want to cache is a good idea. As it seems that you hate my design so much you are ready to say that it is useless, just because it helps me do what I want :-P I would accept the argument of "speed issue", but of course you cannot use that one AND defend the "key" parameter, which has an easier workaround than my problem here and a higher cost. So it is both or none, see ? :-P Nathann > > 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 a topic in the Google > Groups "sage-devel" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sage-devel/OPe5VJpBiB4/unsubscribe. > To unsubscribe from this group and all its topics, 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. -- 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.