Opened 6 months ago

Closed 6 months ago

#27885 closed enhancement (fixed)

Py3: symbolic/expression.pyx fix some errors

Reported by: vklein Owned by:
Priority: major Milestone: sage-8.8
Component: python3 Keywords:
Cc: Merged in:
Authors: Vincent Klein Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: 7658b8e (Commits) Commit: 7658b8ee363c2c4b619310cb90efa4b149c0c711
Dependencies: Stopgaps:

Description (last modified by vklein)

  • Fix the errors AttributeError: 'sage.symbolic.expression.Expression' object has no attribute '__nonzero__' appearing in python3.

'__nonzero__' is renamed into '__bool__' in python3.

  • Use #py2 #py3 tag to manage the difference of messages for TypeError when an object is not subscriptable.
  • Fix the following doctest:
    sage: Set([-x + y < 0, x - y < 0])
    {-x + y < 0, x - y < 0}
    

The later used to randomly fail because the output order was not constant with python3.

Change History (9)

comment:1 Changed 6 months ago by vklein

  • Branch set to u/vklein/27885

comment:2 Changed 6 months ago by git

  • Commit set to 7cf1dab075cf06a166eb127b2aa58fef3b48ff5d

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

7cf1dabTrac #27885: expression.pyx fix __nonzero__ ...

comment:3 Changed 6 months ago by vklein

  • Description modified (diff)

comment:4 Changed 6 months ago by git

  • Commit changed from 7cf1dab075cf06a166eb127b2aa58fef3b48ff5d to 2a2f195eda640a8a576d20f22de2ae35452e35f3

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

2a2f195Trac #27885: expression.pyx fix __nonzero__ ...

comment:5 Changed 6 months ago by vklein

  • Description modified (diff)

comment:6 Changed 6 months ago by git

  • Commit changed from 2a2f195eda640a8a576d20f22de2ae35452e35f3 to 7658b8ee363c2c4b619310cb90efa4b149c0c711

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

7658b8eTrac #27885: expression.pyx ...

comment:7 Changed 6 months ago by vklein

  • Status changed from new to needs_review

comment:8 Changed 6 months ago by chapoton

  • Reviewers set to Frédéric Chapoton
  • Status changed from needs_review to positive_review

ok, thx

comment:9 Changed 6 months ago by vbraun

  • Branch changed from u/vklein/27885 to 7658b8ee363c2c4b619310cb90efa4b149c0c711
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.