On this page
  1. sre_compile.isstring
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

sre_compile.isstring

Prev: sre_compile.error | Up: sre_compile | Next: sre_compile.PatternError
Rel: sre_compile.compile, sre_compile.dis, sre_compile.error, sre_compile.PatternError
Ref: docs.python.org — sre_compile.isstring
Tags: #public #python3 #stdlib #sre_compile


Import

import sre_compile
from sre_compile import isstring

Signature & Overview

sre_compile.isstring(obj)

sre_compile.isstring() function.

Usage

# Prefer isinstance(obj, (str, bytes)) instead of deprecated sre_compile.isstring()
assert isinstance('abc', (str, bytes))

Gotchas

REPL Inspect

from sre_compile import isstring
help(isstring)

Linked from

Related notes