Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some cleanup around if statements #26989

Closed
fchapoton opened this issue Jan 1, 2019 · 14 comments
Closed

some cleanup around if statements #26989

fchapoton opened this issue Jan 1, 2019 · 14 comments

Comments

@fchapoton
Copy link
Contributor

There are a few places with code like

if(something):

This is turned into more pythonic shape.

Component: refactoring

Author: Frédéric Chapoton

Branch/Commit: 14b42ef

Reviewer: Jeroen Demeyer

Issue created by migration from https://trac.sagemath.org/ticket/26989

@fchapoton fchapoton added this to the sage-8.6 milestone Jan 1, 2019
@fchapoton
Copy link
Contributor Author

Commit: 361932f

@fchapoton
Copy link
Contributor Author

Branch: u/chapoton/26989

@fchapoton
Copy link
Contributor Author

New commits:

361932fcleanup around some if statements

@fchapoton

This comment has been minimized.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 2, 2019

Changed commit from 361932f to 85a22d3

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 2, 2019

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

85a22d3trac 26989 fix doctests

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 2, 2019

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

14b42eftrac 26989 fixing the pyflakes warnings

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 2, 2019

Changed commit from 85a22d3 to 14b42ef

@jdemeyer
Copy link

jdemeyer commented Jan 2, 2019

comment:5

Why didn't you remove parentheses here?

if (p_up[0] <= p_down[0] or p_down[1] <= p_up[1]):

@jdemeyer
Copy link

jdemeyer commented Jan 2, 2019

comment:6

Cython style comment: when comparing C pointers, I prefer is to == to make it clear that we are dealing with object identity (pointers are equal). So I would write if r != currRing: as if r is not currRing:

@jdemeyer
Copy link

jdemeyer commented Jan 2, 2019

comment:7

Cython performance comment: product() is not optimized by Cython, so

for (x,y) in product(range(n),range(m)):

is a lot slower than a nested loop

cdef Py_ssize_t x, y
for x in range(n):
    for y in range(m):

I'm not saying that this is necessarily a big problem here, but I thought I should mention it for future reference.

@jdemeyer
Copy link

jdemeyer commented Jan 2, 2019

Reviewer: Jeroen Demeyer

@embray
Copy link
Contributor

embray commented Jan 15, 2019

comment:9

Retarging tickets optimistically to the next milestone. If you are responsible for this ticket (either its reporter or owner) and don't believe you are likely to complete this ticket before the next release (8.7) please retarget this ticket's milestone to sage-pending or sage-wishlist.

@embray embray modified the milestones: sage-8.6, sage-8.7 Jan 15, 2019
@vbraun
Copy link
Member

vbraun commented Jan 26, 2019

Changed branch from u/chapoton/26989 to 14b42ef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants