Opened 4 years ago

Closed 4 years ago

#24246 closed enhancement (fixed)

Add a Cython compile time constant for PY_MAJOR_VERSION

Reported by: embray Owned by:
Priority: major Milestone: sage-8.2
Component: build Keywords:
Cc: Merged in:
Authors: Erik Bray Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: 3ac146c (Commits, GitHub, GitLab) Commit: 3ac146c17ccabbaf53918f874f516909041e82c5
Dependencies: #24215 Stopgaps:

Status badges


As discussed in #24222.

We already have PY_VERSION_HEX which can be useful for more fine-grained version comparisons, but PY_MAJOR_VERSION is easier to use and read in particular for general checks of Python 2 vs. Python >= 3.

Change History (5)

comment:1 Changed 4 years ago by git

  • Commit set to 3ac146c17ccabbaf53918f874f516909041e82c5

Branch pushed to git repo; I updated commit sha1. New commits:

34ef6dcAdd HAVE_GMPY2 compile-time constant
158d984Force absolute import in have_module()
7f06e71Fix documentation
3ac146cAdd a Cython compile-time constant for Python major version.

comment:2 Changed 4 years ago by jdemeyer

  • Component changed from PLEASE CHANGE to build
  • Reviewers set to Jeroen Demeyer
  • Status changed from new to needs_review

comment:3 Changed 4 years ago by jdemeyer

  • Status changed from needs_review to positive_review

comment:4 Changed 4 years ago by embray

  • Milestone changed from sage-8.1 to sage-8.2

comment:5 Changed 4 years ago by vbraun

  • Branch changed from u/embray/python3/compile-time-pyversion to 3ac146c17ccabbaf53918f874f516909041e82c5
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.