GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Improve SyntaxError message for `match` · Issue #151128 · python/cpython Closed Labels stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement DescriptionFeature or enhancementProposal:Currently, Python raises: SyntaxError: invalid syntax. Did you mean 'with'? for This is confusing and irrelevant, because in many other programming languages, switch is a reserved keyword that serves almost the same function as Python’s match. Thus, users typing switch almost certainly intended to use match, mistakenly substituting the keyword from other languages, rather than meaning to write a with statement. Therefore, I believe it’s better to raise: SyntaxError: invalid syntax. Did you mean 'match'? in this case. Additionally, code with typos like mach foo: or matc foo: currently lacks a keyword typo suggestion. Has this already been discussed elsewhere?I have already discussed this feature proposal on Discourse Links to previous discussion of this feature:https://discuss.python.org/t/improve-syntaxerror-message-for-match/107684 Linked PRsReacted by Dan Redding, Eduardo Villalpando Mello and James Addison Activity
MetadataMetadataAssigneesLabelsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |