#17435: Cythonise path algebra elements
-------------------------------------+-------------------------------------
Reporter: SimonKing | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.8
Component: algebra | Resolution:
Keywords: path algebra | Merged in:
elements, days64.5, days65 | Reviewers:
Authors: Simon King | Work issues:
Report Upstream: N/A | Commit:
Branch: | 63f08e1a962acbe620147135c4581ed52f86db2f
public/17435/cythonise_path_algebra_elements| Stopgaps:
Dependencies: #16453 #17526 |
-------------------------------------+-------------------------------------
Comment (by jdemeyer):
Replying to [comment:78 SimonKing]:
> What is the general advice? What integer types should be used for what
purpose? I still do not have a clear picture of int, long, size_t,
mp_size_t, etc.
OK, some general advice just from the top of my head:
1. Most importantly, be consistent: try not to assign a `long` to an
`int`, make sure that loop counters and loop bounds have the same type.
2. In most cases, `long` is a good type to use.
3. Use `int` only if you know for theoretical reasons that the value must
be small (say, at most `2^31 - 1`). There is no theoretical reason why a
reference counter cannot be `2^32`, so `int` is not the right type for
that. An `int` is usually good for booleans or for enumerating several
possibilities.
4. Use `Py_ssize_t` for lengths and sizes of Python objects.
5. Use `size_t` for lengths and sizes of non-Python objects and of memory
chunks. Note that this is an ''unsigned'' type.
--
Ticket URL: <http://trac.sagemath.org/ticket/17435#comment:80>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.