Skip to content

(num) - Python ​

numeric literals

clojure
(num val?)

Where:

  1. val: numeric value or range to match *

Behavior ​

  • Supports range matching with inclusive bounds using the .. syntax.

Examples ​

Find magic numbers in timeout configurations.

clojure
(num 1000..5000)

Selects in lines { 1, 2 } but not in { 3 }:

python
TIMEOUT = 1000
RETRY = 5000
LONG_WAIT = 10000

Locate HTTP status codes in the 4xx range.

clojure
(num 400..499)

Selects in lines { 1 } but not in { 3 }:

python
if status == 404:
    pass
if status == 500:
    pass

Arguments ​

val ​

  1. Number
  2. Numeric Range

Does NOT support: Composition — Free-form Selection — Refinement — Replacement

Copyright © 2022-present Semantic Works, Inc.