Opened 4 years ago
Closed 4 years ago
#26147 closed defect (fixed)
py3: replace tests for attribute iteritems
Reported by: | dkrenn | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-8.5 |
Component: | python3 | Keywords: | |
Cc: | cheuberg | Merged in: | |
Authors: | Frédéric Chapoton | Reviewers: | Clemens Heuberger |
Report Upstream: | N/A | Work issues: | |
Branch: | 3220613 (Commits, GitHub, GitLab) | Commit: | 3220613358332abd7a2be92c1621ebc03b08dc7c |
Dependencies: | Stopgaps: |
Description (last modified by )
Replace hasattr( ..., 'iteritems')
by hasattr( ..., 'items')
.
Change History (10)
comment:1 Changed 4 years ago by
- Branch set to u/dkrenn/py3-fsm
comment:2 Changed 4 years ago by
- Commit set to c5e75a00194e2759c8f227d1bad631fff55c3cab
comment:3 Changed 4 years ago by
- Cc cheuberg added
comment:4 Changed 4 years ago by
I'd prefer to have a solution which solves this at a more global level, e.g. a function has_items()
which performs this check and can be removed at the fullness of time when python2 support is dropped; similar in style to six. If these here are the only occurrences within all of sage, then this would of course be overkill.
comment:5 Changed 4 years ago by
For the record #26468 and #26466 fix some py3 issues for FiniteStateMachines?.
comment:6 Changed 4 years ago by
And note that mapping types also have an items
methods. I think if hasattr(data, 'iteritems') or hasattr(data, 'items'):
can be simplified into if hasattr(data, 'items'):
.
comment:7 Changed 4 years ago by
- Branch changed from u/dkrenn/py3-fsm to public/ticket/26147
- Commit changed from c5e75a00194e2759c8f227d1bad631fff55c3cab to 3220613358332abd7a2be92c1621ebc03b08dc7c
- Status changed from new to needs_review
comment:8 Changed 4 years ago by
- Description modified (diff)
- Reviewers set to Clemens Heuberger
- Status changed from needs_review to positive_review
- Summary changed from py3: doctests FiniteStateMachines to py3: replace tests for attribute iteritems
comment:9 Changed 4 years ago by
- Milestone changed from sage-8.4 to sage-8.5
comment:10 Changed 4 years ago by
- Branch changed from public/ticket/26147 to 3220613358332abd7a2be92c1621ebc03b08dc7c
- Resolution set to fixed
- Status changed from positive_review to closed
...a first start.
New commits:
fix dicts and iter etc