mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
Update 1_5_0.md
This commit is contained in:
parent
f17c764a43
commit
ade87cb848
@ -6,7 +6,7 @@ order: 25
|
||||
|
||||
We are applying a major API refactoring in this release. The main goal is to make the API more consistent and easier to use. We are also adding new features and improvements. This release is not backward compatible with the previous versions. Please read the following guide to upgrade your project.
|
||||
|
||||
## New style bindings
|
||||
## Old style bindings
|
||||
|
||||
We introduced the new style bindings `vm->bind` in [`v1.1.3`](https://github.com/pocketpy/pocketpy/releases/tag/v1.1.3) and deprecated the old style bindings `vm->bind_func<>` and `vm->bind_method<>`.
|
||||
|
||||
@ -85,7 +85,22 @@ int main(){
|
||||
}
|
||||
```
|
||||
|
||||
## Optimization of `vm->bind__next__`
|
||||
## Signature of `_import_handler`
|
||||
|
||||
The signature of `_import_handler` was changed from:
|
||||
|
||||
```cpp
|
||||
unsigned char* (*)(const char* name_p, int name_size, int* out_size);
|
||||
```
|
||||
|
||||
to:
|
||||
```cpp
|
||||
unsigned char* (*)(const char* name, int* out_size);
|
||||
```
|
||||
|
||||
This is because `str` object was ensured to be null-terminated after `v1.4.1`.
|
||||
|
||||
## Signature of `bind__next__`
|
||||
|
||||
`vm->bind__next__` is a special method that is used to implement the iterator protocol.
|
||||
Previously, if you want to return multiple values, you need to pack them into a tuple.
|
||||
@ -178,4 +193,4 @@ Enabling the profiler has a performance overhead. Only enable it when you need i
|
||||
## Type checking functions
|
||||
|
||||
+ `vm->is_non_tagged_type` was removed. Use `vm->is_type` instead.
|
||||
+ `vm->check_non_tagged_type` was removed. Use `vm->check_type` instead.
|
||||
+ `vm->check_non_tagged_type` was removed. Use `vm->check_type` instead.
|
||||
|
Loading…
x
Reference in New Issue
Block a user