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

PEP 3103 (switch statements): inconsistency between a list and references to it #1387

Closed
ericvsmith opened this issue Apr 29, 2020 · 6 comments
Assignees
Labels

Comments

@ericvsmith
Copy link
Member

In https://www.python.org/dev/peps/pep-3103/#option-3 there's a numbered list of options for handling case statements outside of functions.

However, the following text refers to these list items by lowercase letters, not by number. I think the list should be changed to be identified by lowercase letters. There are already too many numbered options in the PEP.

@ericvsmith ericvsmith added the bug label Apr 29, 2020
@gvanrossum
Copy link
Member

Go and submit a PR. However, if you're thinking of reviving this PEP, contact me first; I am in the midst of a design for pattern matching.

@ericvsmith
Copy link
Member Author

I don't intend to revive the PEP. I was just reading it because it was referenced elsewhere and I thought I'd refresh my understanding of what position the PEP took, and how it might relate to pattern matching, which I think is more useful. Glad to see you're thinking of pattern matching.

I noticed the error and thought I'd create an issue while I remembered it. I might just mention it on the mentors mailing list as a super-easy issue in case someone there is looking for something easy to get their feet wet. Although maybe not: since it's not the normal cpython workflow in this repo, maybe it's not a good example for a beginner.

@ericvsmith
Copy link
Member Author

Hmm, this exceeds my ReST knowledge. The source already uses (a), (b), etc., but when displayed at https://www.python.org/dev/peps/pep-3103/#option-3 they show up as 1, 2, etc. So someone who knows more about it will need to fix this. I'll leave this issue in case someone wants to give it a shot.

@gvanrossum
Copy link
Member

It looks like a CSS problem. The bulleted list has

<ol class="loweralpha simple">

s I'm guessing there's no CSS style for that (and hereby my CSS knowledge is exhausted).

@hugovk
Copy link
Member

hugovk commented Apr 30, 2020

list-style or list-style-type needs to be lower-alpha or lower-latin abc:

https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type

The style for the <ol> is indeed list-style: lower-latin (right click and inspect in the browser):

image

However, the style that's applied to the <li> in the browser is list-style: decimal:

image

Changing it in the browser to lower-alpha or lower-latin shows abc:

image

https://developer.mozilla.org/en-US/docs/Web/CSS/list-style


pep.css contains:

ol.arabic {
  list-style: decimal }

ol.loweralpha {
  list-style: lower-alpha }

ol.upperalpha {
  list-style: upper-alpha }

ol.lowerroman {
  list-style: lower-roman }

ol.upperroman {
  list-style: upper-roman }

Looking at the source of https://www.python.org/dev/peps/pep-3103/#option-3:

    <link href="/static/stylesheets/style.30afed881237.css" rel="stylesheet" type="text/css" title="default" />
    <link href="/static/stylesheets/mq.eef77a5d2257.css" rel="stylesheet" type="text/css" media="not print, braille, embossed, speech, tty" />

The first looks like minified pep.css and the only with list-styles:

ol{margin-left:1.5em}ul{list-style:square}ol{list-style:decimal}ol ol{list-style:upper-alpha}ol ol ol{list-style:lower-roman}ol ol ol ol{list-style:lower-alpha}nav ul,menu ul,.menu,form ul,.errorlist,.text form label+ul,.sidebar-widget form label+ul,.tabs{margin-left:0;list-style:none;list-style-image:none}

Putting that through a prettifier:

ul {
	list-style: square
}

ol {
	list-style: decimal
}

ol ol {
	list-style: upper-alpha
}

ol ol ol {
	list-style: lower-roman
}

ol ol ol ol {
	list-style: lower-alpha
}

Which doesn't quite look right... Is there something broken in the minifier?

@AA-Turner AA-Turner self-assigned this Jan 23, 2022
@AA-Turner
Copy link
Member

Fixed with peps.python.org

A

image

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

No branches or pull requests

4 participants