Structural Pattern Matching
E253899
Structural Pattern Matching is a Python language feature, introduced via PEP 622, that enables powerful, declarative matching of complex data structures using a `match`/`case` syntax.
All labels observed (4)
How this entity was disambiguated
This entity first appeared as the object of triple T2301338 — resolving that mention is where its identity was fixed. The disambiguator weighed these candidate entities and picked the highlighted one (or “None”, minting a new entity). This is how homonymy is resolved: the same surface form can point to different entities.
Target entity: Structural Pattern Matching Context triple: [PEP 622, hasTitle, Structural Pattern Matching]
-
A.
Hindley–Milner type system
The Hindley–Milner type system is a classical polymorphic type system used in many functional programming languages, notable for enabling type inference without explicit type annotations.
-
B.
The Definition of Standard ML
The Definition of Standard ML is the formal language specification that rigorously defines the syntax and semantics of the Standard ML functional programming language.
-
C.
Thompson's algorithm for regular expression matching
Thompson's algorithm for regular expression matching is a classic method that converts regular expressions into nondeterministic finite automata (NFAs) to enable efficient pattern matching in text processing.
-
D.
Modularity, Objects, and State
"Modularity, Objects, and State" is a chapter in the classic computer science textbook *Structure and Interpretation of Computer Programs* that explores how to structure programs using modular design, data abstraction, and mutable state, including object-oriented techniques.
-
E.
Types and Programming Languages (research contributions)
Types and Programming Languages (research contributions) refers to Tobias Nipkow’s influential work advancing the theory and mechanization of type systems and programming language semantics, particularly through formal verification and theorem proving.
- F. None of above. chosen
- G. Unsure - the case is ambiguous/there is not enough information to decide.
Target entity: Structural Pattern Matching Target entity description: Structural Pattern Matching is a Python language feature, introduced via PEP 622, that enables powerful, declarative matching of complex data structures using a `match`/`case` syntax.
-
A.
Hindley–Milner type system
The Hindley–Milner type system is a classical polymorphic type system used in many functional programming languages, notable for enabling type inference without explicit type annotations.
-
B.
The Definition of Standard ML
The Definition of Standard ML is the formal language specification that rigorously defines the syntax and semantics of the Standard ML functional programming language.
-
C.
Thompson's algorithm for regular expression matching
Thompson's algorithm for regular expression matching is a classic method that converts regular expressions into nondeterministic finite automata (NFAs) to enable efficient pattern matching in text processing.
-
D.
Modularity, Objects, and State
"Modularity, Objects, and State" is a chapter in the classic computer science textbook *Structure and Interpretation of Computer Programs* that explores how to structure programs using modular design, data abstraction, and mutable state, including object-oriented techniques.
-
E.
Types and Programming Languages (research contributions)
Types and Programming Languages (research contributions) refers to Tobias Nipkow’s influential work advancing the theory and mechanization of type systems and programming language semantics, particularly through formal verification and theorem proving.
- F. None of above. chosen
Statements (50)
| Predicate | Object |
|---|---|
| instanceOf | Python language feature ⓘ |
| availableFromVersion | 3.10 ⓘ |
| belongsTo | Python language core ⓘ |
| canMatch |
dictionaries
ⓘ
enums ⓘ lists ⓘ literals ⓘ tuples ⓘ user-defined classes ⓘ |
| definedIn | PEP 634 ⓘ |
| enables |
concise handling of variant data types
ⓘ
data-driven control flow ⓘ more readable branching logic ⓘ |
| evaluates | patterns top to bottom ⓘ |
| fallsThrough | no ⓘ |
| hasMotivationIn | PEP 635 ⓘ |
| hasSemanticsSpecifiedIn | PEP 634 ⓘ |
| hasSyntaxKeyword |
case
ⓘ
match ⓘ |
| hasTutorialIn | PEP 636 ⓘ |
| inspiredBy |
pattern matching in Haskell
ⓘ
pattern matching in Rust ⓘ pattern matching in Scala ⓘ pattern matching in functional languages ⓘ |
| introducedBy | PEP 622 ⓘ |
| introducedIn | Python 3.10 ⓘ |
| is | a structural rather than nominal matching system ⓘ |
| isAlsoKnownAs |
Python pattern matching
ⓘ
match-case syntax ⓘ |
| notAvailableBeforeVersion | 3.10 ⓘ |
| requires | subject expression after match keyword ⓘ |
| selects | first matching case ⓘ |
| supports |
AS patterns
ⓘ
OR patterns ⓘ capture patterns ⓘ class patterns ⓘ declarative pattern matching ⓘ destructuring of values ⓘ keyword subpatterns ⓘ literal patterns ⓘ mapping patterns ⓘ matching of complex data structures ⓘ pattern guards ⓘ positional subpatterns ⓘ sequence patterns ⓘ value patterns ⓘ wildcard patterns ⓘ |
| uses | case clauses for patterns ⓘ |
| usesKeyword |
case _ as wildcard pattern
ⓘ
if for pattern guards ⓘ |
How these facts were elicited
The pipeline generated the facts above by prompting gpt-5.1 with this entity's name + description and the instruction below.
You are a knowledge base construction expert. Given a subject entity and a description of it, return factual statements that you know for the subject as a JSON list of dictionaries(triples), where keys must be "subject", "predicate" and "object". The number of facts may be very high, between 25 to 50 or more, for very popular subjects. For less popular subjects, the number of facts can be very low, like 5 or 10. # Requirements - If you don't know the subject at all, return an empty list. - If the subject is not a named entity, return an empty list. - Include at least one triple where predicate is "instanceOf". - Do not get too wordy. - Separate several objects into multiple triples with one object.
Subject: Structural Pattern Matching Description of subject: Structural Pattern Matching is a Python language feature, introduced via PEP 622, that enables powerful, declarative matching of complex data structures using a `match`/`case` syntax.
Referenced by (4)
Full triples — surface form annotated when it differs from this entity's canonical label.