Commit Graph
18 Commits
Author SHA1 Message Date
Jeong, YunWon c8d63e848e Materialize code constants through the VM (#8867)
PyObjBag built code object constants from a Context alone, and its
frozenset arm was unimplemented!(), so ctx.new_code() panicked on code
containing a frozenset constant such as `x in {1, 2, 3}`.

IntoCodeObject now takes a VirtualMachine and uses PyVmBag for bytecode
and frozen code objects. Context::new_code, PyObjBag and
AsBag for &Context are removed; callers use VirtualMachine::new_code.

Assisted-by: Claude:claude-opus-5-5
Assisted-by: Grok:grok-4.7
2026-10-02 17:24:46 +09:00
Jeong, YunWon 0940849029 Borrow tp_descr_get/tp_init arguments and by-value public helpers (#8803)
* Borrow tp_descr_get/tp_init arguments and by-value public helpers

- DescrGetFunc and GetDescriptor::descr_get take
  (&PyObject, Option<&PyObject>, Option<&PyObject>); impls call
  .to_owned() where they store or return an argument.
- InitFunc takes &PyObject and Initializer::init takes &Py<Self>.
- VirtualMachine::get_attribute_opt, print_exception,
  call_get_descriptor(_specific) and other helpers flagged by
  clippy::needless_pass_by_value take &PyObject / &Py<T>; callers in
  crates/, examples/ and tests/ drop the clones made for the call.

Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Grok CLI:grok-4.7

* Pass the borrowed zelf to internal_close in WindowsConsoleIO init

Assisted-by: Claude Code:claude-opus-5-5

* Fix borrowed signatures missed by the rebase

OrderedDict.init, classmethod_descriptor.descr_get, and the warnings
get_attribute_opt callers still used owned handles.

Assisted-by: Grok CLI:grok-4.7
2026-09-24 14:25:07 +09:00
Joshua Megnauth 86c7fa20c4 Fix missing workspace lints & fix lints (#8781)
Some of the workspace packages were missing the `[lints]` table. I
enabled the lints then fixed the resulting errors.
2026-09-24 07:49:50 +09:00
Noa 276a4bdc80 Make paths in macro arguments relative to the source file, not MANIFEST_DIR (#6873) 2026-01-30 22:37:18 +09:00
Rex Ledesma 4e2e0b41c6 chore: add ruff format --check (#5774)
* chore: add `ruff format --check`

* fix tests
2025-05-12 14:20:01 +09:00
Jeong Yunwon 93d1438345 PyObjBag refers Context instead of vm 2022-05-16 04:45:13 +09:00
Jeong Yunwon 6fd5094c05 Remove Interpreter::default() not to trap users init without stdlib 2022-04-30 05:09:33 +09:00
Jeong YunWon 256de1eb46 Move free functions in vm::exceptions to vm methods 2021-10-13 05:53:43 +09:00
Christoph Herzog bca704ed99 Examples Wording Issue - relative <=> relevant
Just a simple drive-by fix for the wording in the freeze example
2021-09-09 13:53:46 +02:00
Noah 99104faaf7 Re-export pyobject::* from the root of the crate 2021-05-20 10:24:07 -05:00
Noah 58503cb0fa Serialize entire frozen hashmap to bytes 2021-01-29 00:46:51 -06:00
Noah b30ca99a09 Implement string interning 2020-11-08 21:35:04 -06:00
Ben Lewis c54b4bb833 Split py_compile_bytecode into py_compile and py_freeze. 2020-09-18 18:59:58 +12:00
Noah 18273da108 Interpreter struct for managing thread-local vm stack 2020-09-15 16:44:39 -05:00
Noah ba8c0d9a82 Use sys.excepthook when exceptions bubble to the top level 2020-08-02 12:23:12 -05:00
Noah 2f77be17d8 Don't put the freeze example as a workspace member 2020-07-27 18:47:09 -05:00
Noah bc1717b7ac Release 0.1.2
rustpython@0.1.2
rustpython-bytecode@0.1.2
rustpython-compiler@0.1.2
rustpython-derive@0.1.2
rustpython-parser@0.1.2
rustpython-vm@0.1.2
rustpython_freeze@0.1.2
rustpython_wasm@0.1.2

Generated by cargo-workspaces
2020-06-23 18:47:08 -05:00
Aviv Palivoda 81093bb6f4 Move freeze example to examples folder 2020-03-06 10:05:47 +02:00