pyobject 1.3.5__tar.gz → 1.3.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyobject-1.3.5/pyobject.egg-info → pyobject-1.3.5.1}/PKG-INFO +82 -82
- {pyobject-1.3.5 → pyobject-1.3.5.1}/README.md +2 -2
- {pyobject-1.3.5 → pyobject-1.3.5.1}/README.rst +541 -541
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/__init__.py +29 -22
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/browser.py +9 -8
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/pyobj_extension.c +2 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1/pyobject.egg-info}/PKG-INFO +82 -82
- {pyobject-1.3.5 → pyobject-1.3.5.1}/setup.py +2 -2
- {pyobject-1.3.5 → pyobject-1.3.5.1}/LICENSE +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/MANIFEST.in +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/code.py +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/back.gif +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/codeobject.gif +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/dict.gif +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/empty_dict.gif +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/empty_list.gif +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/empty_tuple.gif +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/forward.gif +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/function.gif +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/list.gif +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/number.gif +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/python.gif +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/python.ico +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/refresh.gif +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/string.gif +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/images/tuple.gif +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/objproxy/__init__.py +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/objproxy/builtin_hook.py +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/objproxy/optimize.py +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/objproxy/utils.py +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/search.py +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/tests/test_code.py +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/tests/test_objproxy.py +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject/tests/test_objproxy_perf.py +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject.egg-info/SOURCES.txt +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject.egg-info/dependency_links.txt +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject.egg-info/requires.txt +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/pyobject.egg-info/top_level.txt +0 -0
- {pyobject-1.3.5 → pyobject-1.3.5.1}/setup.cfg +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyobject
|
|
3
|
-
Version: 1.3.5
|
|
3
|
+
Version: 1.3.5.1
|
|
4
4
|
Summary: A multifunctional all-in-one utility tool for managing internal Python objects, compatible with nearly all Python 3 versions.
|
|
5
5
|
Home-page: https://github.com/ekcbw/pyobject
|
|
6
6
|
Author: ekcbw
|
|
7
7
|
Author-email: u81430728@163.com
|
|
8
|
-
Keywords: pyobject,python,object,utility,object browser,bytecode,reflect,object search,OOP,reverse
|
|
8
|
+
Keywords: pyobject,python,object,utility,object browser,bytecode,reflect,object search,OOP,reverse
|
|
9
9
|
Classifier: Programming Language :: Python
|
|
10
10
|
Classifier: Topic :: Utilities
|
|
11
11
|
Classifier: Topic :: Software Development :: Bug Tracking
|
|
@@ -138,41 +138,41 @@ default ``CodeType`` object is created.
|
|
|
138
138
|
Attributes
|
|
139
139
|
^^^^^^^^^^
|
|
140
140
|
|
|
141
|
-
-
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
- ``_code``: The internal bytecode of the current ``Code`` object. Use
|
|
142
|
+
``exec(c._code)`` or ``exec(c.to_code())`` instead of directly using
|
|
143
|
+
``exec(c)``.
|
|
144
144
|
|
|
145
145
|
The following are attributes of Python’s built-in bytecode (also
|
|
146
146
|
attributes of the ``Code`` object). While Python’s internal ``CodeType``
|
|
147
147
|
bytecode is immutable and these attributes are read-only, the ``Code``
|
|
148
148
|
object is mutable, meaning these attributes can be **modified**:
|
|
149
149
|
|
|
150
|
-
-
|
|
151
|
-
|
|
152
|
-
-
|
|
153
|
-
|
|
154
|
-
-
|
|
155
|
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
-
|
|
163
|
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
|
|
168
|
-
-
|
|
169
|
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
172
|
-
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
|
|
150
|
+
- ``co_argcount``: The number of positional arguments (including those
|
|
151
|
+
with default values).
|
|
152
|
+
- ``co_cellvars``: A tuple containing the names of local variables
|
|
153
|
+
referenced by nested functions.
|
|
154
|
+
- ``co_code``: A ``bytes`` object representing the sequence of bytecode
|
|
155
|
+
instructions, storing the actual binary bytecode.
|
|
156
|
+
- ``co_consts``: A tuple containing the literals used by the bytecode.
|
|
157
|
+
- ``co_filename``: The filename of the source code being compiled.
|
|
158
|
+
- ``co_firstlineno``: The first line number of the source code
|
|
159
|
+
corresponding to the bytecode. Used internally by the interpreter in
|
|
160
|
+
combination with ``co_lnotab`` to output precise line numbers in
|
|
161
|
+
tracebacks.
|
|
162
|
+
- ``co_flags``: An integer encoding multiple flags used by the
|
|
163
|
+
interpreter.
|
|
164
|
+
- ``co_freevars``: A tuple containing the names of free variables.
|
|
165
|
+
- ``co_kwonlyargcount``: The number of keyword-only arguments.
|
|
166
|
+
- ``co_lnotab``: A string encoding the mapping of bytecode offsets to
|
|
167
|
+
line numbers (replaced by ``co_linetable`` in Python 3.10).
|
|
168
|
+
- ``co_name``: The name of the function/class corresponding to the
|
|
169
|
+
bytecode.
|
|
170
|
+
- ``co_names``: A tuple containing the names used by the bytecode.
|
|
171
|
+
- ``co_nlocals``: The number of local variables used by the function
|
|
172
|
+
(including arguments).
|
|
173
|
+
- ``co_stacksize``: The stack size required to execute the bytecode.
|
|
174
|
+
- ``co_varnames``: A tuple containing the names of local variables
|
|
175
|
+
(starting with argument names).
|
|
176
176
|
|
|
177
177
|
Attributes introduced in Python 3.8 and later: - ``co_posonlyargcount``:
|
|
178
178
|
The number of positional-only arguments, introduced in Python 3.8. -
|
|
@@ -186,66 +186,66 @@ Methods
|
|
|
186
186
|
|
|
187
187
|
**Core Methods**
|
|
188
188
|
|
|
189
|
-
-
|
|
190
|
-
|
|
191
|
-
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
-
|
|
195
|
-
|
|
196
|
-
-
|
|
197
|
-
|
|
198
|
-
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
-
|
|
203
|
-
|
|
204
|
-
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
189
|
+
- ``exec(globals_=None, locals_=None)``: Executes the code object
|
|
190
|
+
within the provided global and local scope dictionaries.
|
|
191
|
+
- ``eval(globals_=None, locals_=None)``: Executes the code object
|
|
192
|
+
within the provided global and local scope dictionaries and returns
|
|
193
|
+
the result.
|
|
194
|
+
- ``copy()``: Creates a copy of the ``Code`` object and returns the
|
|
195
|
+
duplicate.
|
|
196
|
+
- ``to_code()``: Converts the ``Code`` instance back to a built-in
|
|
197
|
+
``CodeType`` object, equivalent to ``c._code``.
|
|
198
|
+
- ``to_func(globals_=None, name=None, argdefs=None, closure=None, kwdefaults=None)``:
|
|
199
|
+
Converts the code object into a Python function. The parameters are
|
|
200
|
+
the same as those used when instantiating Python’s built-in
|
|
201
|
+
``FunctionType``.
|
|
202
|
+
- ``get_flags()``: Returns a list of flag names for the ``co_flags``
|
|
203
|
+
attribute, e.g., ``["NOFREE"]``.
|
|
204
|
+
- ``get_sub_code(name)``: Searches for sub-code objects (e.g.,
|
|
205
|
+
functions or class definitions) in the ``co_consts`` attribute. This
|
|
206
|
+
method does not perform recursive searches. Returns the found
|
|
207
|
+
``Code`` object or raises a ``ValueError`` if not found.
|
|
208
208
|
|
|
209
209
|
**Serialization**
|
|
210
210
|
|
|
211
|
-
-
|
|
212
|
-
|
|
213
|
-
-
|
|
214
|
-
|
|
215
|
-
-
|
|
216
|
-
|
|
217
|
-
-
|
|
218
|
-
|
|
211
|
+
- ``to_pycfile(filename)``: Dumps the code object into a ``.pyc`` file
|
|
212
|
+
using the ``marshal`` module.
|
|
213
|
+
- ``from_pycfile(filename)``: Creates a ``Code`` instance from a
|
|
214
|
+
``.pyc`` file.
|
|
215
|
+
- ``from_file(filename)``: Creates a ``Code`` instance from a ``.py``
|
|
216
|
+
or ``.pyc`` file.
|
|
217
|
+
- ``pickle(filename)``: Serializes the ``Code`` object into a pickle
|
|
218
|
+
file.
|
|
219
219
|
|
|
220
220
|
**Debugging and Inspection**
|
|
221
221
|
|
|
222
|
-
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
-
|
|
226
|
-
|
|
227
|
-
-
|
|
228
|
-
|
|
229
|
-
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
222
|
+
- ``show(*args, **kw)``: Internally calls ``pyobject.desc`` to display
|
|
223
|
+
the attributes of the code object. The parameters are the same as
|
|
224
|
+
those used in ``desc()``.
|
|
225
|
+
- ``info()``: Internally calls ``dis.show_code`` to display basic
|
|
226
|
+
information about the bytecode.
|
|
227
|
+
- ``dis(*args, **kw)``: Calls the ``dis`` module to output the
|
|
228
|
+
disassembly of the bytecode, equivalent to ``dis.dis(c.to_code())``.
|
|
229
|
+
- ``decompile(version=None, *args, **kw)``: Calls the ``uncompyle6``
|
|
230
|
+
library to decompile the code object into source code. (The
|
|
231
|
+
``uncompyle6`` library is optional when installing the ``pyobject``
|
|
232
|
+
package.)
|
|
233
233
|
|
|
234
234
|
**Factory Functions**
|
|
235
235
|
|
|
236
|
-
-
|
|
237
|
-
|
|
238
|
-
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
236
|
+
- ``fromfunc(function)``: Creates a ``Code`` instance from a Python
|
|
237
|
+
function object, equivalent to ``Code(func.__code__)``.
|
|
238
|
+
- ``fromstring(string, mode='exec', filename='')``: Creates a ``Code``
|
|
239
|
+
instance from a source code string. The parameters are the same as
|
|
240
|
+
those used in the built-in ``compile`` function, which is called
|
|
241
|
+
internally.
|
|
242
242
|
|
|
243
243
|
Compatibility Details
|
|
244
244
|
^^^^^^^^^^^^^^^^^^^^^
|
|
245
245
|
|
|
246
|
-
-
|
|
247
|
-
|
|
248
|
-
|
|
246
|
+
- Attribute ``co_lnotab``: In Python 3.10 and later, attempts to set
|
|
247
|
+
the ``co_lnotab`` attribute will automatically be converted into
|
|
248
|
+
setting the ``co_linetable`` attribute.
|
|
249
249
|
|
|
250
250
|
Example usage: (excerpted from the doctest):
|
|
251
251
|
|
|
@@ -511,15 +511,15 @@ pointers to improve the performance.
|
|
|
511
511
|
|
|
512
512
|
Return the internal dictionary for interning strings (``sys.intern()``).
|
|
513
513
|
|
|
514
|
-
**Current ``pyobject`` Version**: 1.3.5
|
|
514
|
+
**Current ``pyobject`` Version**: 1.3.5.1
|
|
515
515
|
|
|
516
516
|
Change Log
|
|
517
517
|
----------
|
|
518
518
|
|
|
519
519
|
| 2026-7-5(v1.3.5): Added ``FrameLocalsProxy`` support for Python 3.13+
|
|
520
|
-
and high DPI support for non-Windows platforms.
|
|
521
|
-
|
|
522
|
-
module (available for 3.12+).
|
|
520
|
+
and high DPI support for non-Windows platforms.
|
|
521
|
+
| 2026-1-22(v1.3.4): Added ``get_string_intern_dict()`` to
|
|
522
|
+
``pyobject.pyobj_extension`` module (available for 3.12+).
|
|
523
523
|
| 2026-1-4(v1.3.3): Improved the support for Python 3.14 and
|
|
524
524
|
``describe()`` function. Adjusted the minimum supported Python version
|
|
525
525
|
to 3.6.
|
|
@@ -321,11 +321,11 @@ Compared to the built-in Python call `obj in lst` that invokes the `==` operator
|
|
|
321
321
|
Return the internal dictionary for interning strings (`sys.intern()`).
|
|
322
322
|
|
|
323
323
|
|
|
324
|
-
**Current `pyobject` Version**: 1.3.5
|
|
324
|
+
**Current `pyobject` Version**: 1.3.5.1
|
|
325
325
|
|
|
326
326
|
## Change Log
|
|
327
327
|
|
|
328
|
-
2026-7-5(v1.3.5): Added `FrameLocalsProxy` support for Python 3.13+ and high DPI support for non-Windows platforms.
|
|
328
|
+
2026-7-5(v1.3.5): Added `FrameLocalsProxy` support for Python 3.13+ and high DPI support for non-Windows platforms.
|
|
329
329
|
2026-1-22(v1.3.4): Added `get_string_intern_dict()` to `pyobject.pyobj_extension` module (available for 3.12+).
|
|
330
330
|
2026-1-4(v1.3.3): Improved the support for Python 3.14 and `describe()` function. Adjusted the minimum supported Python version to 3.6.
|
|
331
331
|
2025-6-23(v1.3.2): Added the `use_exported_obj` parameter to the pyobject.objproxy module and further optimized the performance.
|