This commit is contained in:
方而静 2024-06-13 15:03:19 +08:00
parent 249656039a
commit f4e9293643
2 changed files with 3 additions and 7 deletions

View File

@ -34,7 +34,7 @@ struct Dict : private pkpy_Dict {
PyVar try_get(VM* vm, PyVar key) const { PyVar try_get(VM* vm, PyVar key) const {
auto res = pkpy_Dict__try_get(this, vm, *reinterpret_cast<::pkpy_Var*>(&key)); auto res = pkpy_Dict__try_get(this, vm, *reinterpret_cast<::pkpy_Var*>(&key));
if (!res) return nullptr; if (!res) return nullptr;
return *reinterpret_cast<PyVar*>(&res); return PyVar(*reinterpret_cast<PyVar*>(&res));
} }
bool contains(VM* vm, PyVar key) const { bool contains(VM* vm, PyVar key) const {

View File

@ -11,12 +11,8 @@ extern "C" {
* @brief A python value in pocketpy. * @brief A python value in pocketpy.
*/ */
typedef struct { typedef struct {
// TODO: implement
union {
int type; int type;
char buf[16]; int _0, _1, _2;
};
} pkpy_Var; } pkpy_Var;
/** /**