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

Assign None to code C50 #2

Open
leovam opened this issue Jun 25, 2020 · 1 comment
Open

Assign None to code C50 #2

leovam opened this issue Jun 25, 2020 · 1 comment

Comments

@leovam
Copy link

leovam commented Jun 25, 2020

In the line 127 to line 129 in __init__():

sblock, eblock = block.split('-') # A00-B99
salpha, snumeric = ord(sblock[0]), int(sblock[1:].lstrip('0') or 0)
ealpha, enumeric = ord(eblock[0]), int(eblock[1:].lstrip('0') or 0)

This does not work for code C50, since chapter II start from C00 and end with D48, so 50 will larger than 0 but less than 48.

A condition should be added here, thanks

@wbazant
Copy link

wbazant commented Oct 17, 2023

This will work:

       if salpha == ealpha:
            return alpha == salpha and snumeric <= numeric <= enumeric
        else:
            return (salpha <= alpha < ealpha and snumeric <= numeric) or (salpha < alpha <= ealpha and numeric <= enumeric)

#1 (comment)

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

No branches or pull requests

2 participants