On this page
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
- Deprecated internal helper.
REPL Inspect
from sre_compile import isstring
help(isstring)
Linked from
Related notes
- tuts/python3/stdlib_module/sre_compile Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_compile/compile Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_compile/dis Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_compile/error Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_compile/PatternError Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib