Sage
Programming Guide
Up:
SAGE Documentation Index
Next:
Front Matter
Sage
Programming Guide
William Stein and David Joyner
Date:
July 11, 2008
Front Matter
Contents
1. Introduction
2.
Sage
Coding Conventions
2.1 Coding Conventions
2.2 File and Directory names
2.3 Headings of
Sage
Library Code Files
2.4 Documentation Strings
2.4.1 Further conventions for automated testing of examples
2.5 Exceptions
2.6 Optional Packages
2.7 Special
Sage
Functions
2.7.1
LaTeX
Representation
2.7.2 Print Representation
2.7.3 Matrix from Object
2.7.4 Vector from Object
2.8 The
Sage
Rules and Conventions for Coercion and Arithmetic
2.9 Mutability
2.10 Importing Modules
2.11 The
__hash__
Special Method
3. Creating a
Sage
Module or Package
3.1
Sage
Preparsing
3.2 Randomized Testing
3.3 Creating a New
Sage
spkg Package
4. Documentation
4.1 Source Code Documentation
4.2 Extra Documentation
4.3 Automated Testing
4.3.1 Testing .py, .pyx and .sage Files
4.3.2 Testing
LaTeX
Documentation
4.4 Modifying the
Sage
Manuals
5. Writing Optimized Compiled Code With
Sage
5.1 Introduction
5.1.1 Interpreted and Compiled Code
5.1.2 Why Cython is the Best Available Option for
Sage
5.2 Examples
5.2.1 Attaching or Loading
.spyx
Files
5.2.2 Using the Command Line and a File
5.2.3 An Optimization Example
5.2.4 A simple loop example: Sum of squares
5.2.5 Example: 2 Power
5.3 Cython Manual
5.3.1 Memory Usage
5.3.2 Forward-declaring extension types
5.3.3 Using cdef Module-Level Functions in Other Modules
5.3.4 Making it possible to create weak references to extension classes
5.3.5 Public and Private Variables
5.3.6 Arbitrary Attributes
5.3.7 Special Methods
5.3.8 Doctests
5.3.9 Signal Handling
5.3.10 Introspection
5.3.11 Faster Iteration through a Python List or Tuple
5.3.12 getslice
5.3.13 List Comprehensions and In-Place operators
5.3.14 Cython: Dealing with weird build errors
5.4 C++ Nuances
5.4.1 Aliases for Overloading (or other purposes)
5.4.2 Pointers and References
5.4.3 Embedding C++ objects in Cython extension structures
6.
Sage
Interfaces
6.1 The PARI C-library Interface
6.2 GAP
6.3 Singular
6.4 Another Approach
6.5 Creating a new Pseudo-tty Interface
7. Mercurial: The
Sage
Source Control System
7.1 Quick Mercurial tutorial for
Sage
7.2 Updating To the Latest Official
Sage
Library Source Code
8. Miscellaneous
8.1 Circular Imports
8.2 Weird Issues
8.3 Benchmarking
9. History and License
9.1 License
9.1.1 The GNU General Public License
Index
About this document ...
Sage
Programming Guide
Up:
SAGE Documentation Index
Next:
Front Matter
Release 2008.07.11, documentation updated on July 11, 2008.
See
About this document...
for information on suggesting changes.