Package sage :: Package combinat :: Module sloane_functions :: Class Sloane
[hide private]
[frames] | no frames]

Class Sloane

source code

                      object --+    
                               |    
structure.sage_object.SageObject --+
                                   |
                                  Sloane


A collection of Sloane generating functions.

This class inspects sage.combinat.sloane_functions, accumulating all the SloaneSequence classes starting with 'A'.  These are listed for tab completion, but not instantiated until requested.

EXAMPLES:
    Ensure we have lots of entries:
    sage: len(sloane.trait_names()) > 100
    True

    And ensure none are being incorrectly returned:
    sage: [ None for n in sloane.trait_names() if not n.startswith('A') ]
    []

    Ensure we can access dynamic constructions and cache correctly:
    sage: s = sloane.A000587
    sage: s is sloane.A000587
    True

    And that we can access other functions in parent classes:
    sage: sloane.__class__
    <class 'sage.combinat.sloane_functions.Sloane'>

AUTHOR: Nick Alexander



Instance Methods [hide private]
 
trait_names(self)
List Sloane generating functions for tab-completion.
source code
 
__getattribute__(self, name)
Construct and cache unique instances of Sloane generating function objects .
source code

Inherited from structure.sage_object.SageObject: __hash__, __new__, __repr__, _axiom_, _axiom_init_, _gap_, _gap_init_, _gp_, _gp_init_, _interface_, _interface_init_, _interface_is_cached_, _kash_, _kash_init_, _macaulay2_, _macaulay2_init_, _magma_, _magma_init_, _maple_, _maple_init_, _mathematica_, _mathematica_init_, _maxima_, _maxima_init_, _octave_, _octave_init_, _pari_, _pari_init_, _r_init_, _sage_, _singular_, _singular_init_, category, db, dump, dumps, plot, rename, reset_name, save, version

Inherited from object: __delattr__, __init__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

trait_names(self)

source code 
List Sloane generating functions for tab-completion.

The member classes are inspected from module sage.combinat.sloane_functions.

They must be sub classes of SloaneSequence and must start with 'A'.  These
restrictions are only to prevent typos, incorrect inspecting, etc.

EXAMPLES:
    sage: type(sloane.trait_names())
    <type 'list'>

__getattribute__(self, name)

source code 
Construct and cache unique instances of Sloane generating function objects
.

EXAMPLES:
    sage: sloane.__getattribute__('A000001')
    Number of groups of order n.
    sage: sloane.__getattribute__('dog')
    Traceback (most recent call last):
    ...
    AttributeError: dog

Overrides: object.__getattribute__