summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2023-05-04 14:59:46 (GMT)
committerGitHub <noreply@github.com>2023-05-04 14:59:46 (GMT)
commit04f673327530f47f002e784459037231de478412 (patch)
tree56b29e35a1147b9655b5f4b4337f8a2f905b0e3f /Lib/inspect.py
parentb17d32c1142d16a5fea0c95bce185bf9be696491 (diff)
downloadcpython-04f673327530f47f002e784459037231de478412.zip
cpython-04f673327530f47f002e784459037231de478412.tar.gz
cpython-04f673327530f47f002e784459037231de478412.tar.bz2
gh-102500: Implement PEP 688 (#102521)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r--Lib/inspect.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 92c2675..95da7fb 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -43,6 +43,7 @@ __all__ = [
"Attribute",
"BlockFinder",
"BoundArguments",
+ "BufferFlags",
"CORO_CLOSED",
"CORO_CREATED",
"CORO_RUNNING",
@@ -3312,6 +3313,28 @@ def signature(obj, *, follow_wrapped=True, globals=None, locals=None, eval_str=F
globals=globals, locals=locals, eval_str=eval_str)
+class BufferFlags(enum.IntFlag):
+ SIMPLE = 0x0
+ WRITABLE = 0x1
+ FORMAT = 0x4
+ ND = 0x8
+ STRIDES = 0x10 | ND
+ C_CONTIGUOUS = 0x20 | STRIDES
+ F_CONTIGUOUS = 0x40 | STRIDES
+ ANY_CONTIGUOUS = 0x80 | STRIDES
+ INDIRECT = 0x100 | STRIDES
+ CONTIG = ND | WRITABLE
+ CONTIG_RO = ND
+ STRIDED = STRIDES | WRITABLE
+ STRIDED_RO = STRIDES
+ RECORDS = STRIDES | WRITABLE | FORMAT
+ RECORDS_RO = STRIDES | FORMAT
+ FULL = INDIRECT | WRITABLE | FORMAT
+ FULL_RO = INDIRECT | FORMAT
+ READ = 0x100
+ WRITE = 0x200
+
+
def _main():
""" Logic for inspecting an object given at command line """
import argparse