CodeQL library for Python
codeql/python-all 2.2.0 (changelog, source)
Search

Module Patterns

Wrapping generated AST classes: Pattern_ and subclasses.

Import path

import semmle.python.Patterns

Imports

Classes

MatchAsPattern

An as-pattern in a match statement: <subpattern> as alias

MatchCapturePattern

A capture pattern in a match statement: var

MatchClassPattern

A class pattern in a match statement: Circle(radius = 3)

MatchDoubleStarPattern

A double star pattern in a match statement: {..., **}

MatchKeyValuePattern

A key-value pattern inside a mapping pattern: a: var

MatchKeywordPattern

A keyword pattern inside a class pattern: radius = 3

MatchLiteralPattern

A literal pattern in a match statement: 42

MatchMappingPattern

A mapping pattern in a match statement: {'a': var}

MatchOrPattern

An or-pattern in a match statement: (<pattern1>|<pattern2>)

MatchSequencePattern

A sequence pattern in a match statement <p1>, <p2>

MatchStarPattern

A star pattern in a match statement: (..., *)

MatchValuePattern

A value pattern in a match statement: Http.OK

MatchWildcardPattern

A wildcard pattern in a match statement: _

Pattern

A pattern in a match statement