#13566: Simplicial complex examples as singletons
---------------------------------------------------+------------------------
       Reporter:  tscrim                           |         Owner:  tscrim     
     
           Type:  enhancement                      |        Status:  needs_work 
     
       Priority:  minor                            |     Milestone:  sage-5.6   
     
      Component:  algebraic topology               |    Resolution:             
     
       Keywords:  simplicial                       |   Work issues:             
     
Report Upstream:  N/A                              |     Reviewers:  Travis 
Scrimshaw
        Authors:  Christian Nassau, John Palmieri  |     Merged in:             
     
   Dependencies:  #13244, #12587                   |      Stopgaps:             
     
---------------------------------------------------+------------------------

Comment (by nbruin):

 Well ... you could write a decorator that turns a function into a
 UniqueFactory. However, I think you have a more serious problem: The
 routines you are now defining have no business being a method (note that
 you don't use the `self` argument!). Python is not Java. You don't have to
 stuff everything into a class. Much more appropriate is a module (just a
 file with functions). In fact, since your functions are just interfaces to
 SimplicialComplex, any uniqueness of the output value is already ensured
 by that thing. And if it isn't, then either SimplicialComplex should be
 ensuring uniqueness or there's a good reason why it shouldn't and then
 your routines shouldn't ensure uniqueness either. In other words: the
 caching you're proposing should either happen on a deeper level or not at
 all.

 For more information about using modules to gather examples or as
 convenient namespace groupings, see #13115 and this
 [https://groups.google.com/group/sage-
 
devel/browse_thread/thread/76f32baf025a370/4aa1b2f40eadd48c?hl=en&lnk=gst&q=examples+in+module#4aa1b2f40eadd48c
 sage-devel thread].

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13566#comment:19>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to