The following opcodes have been added, see [0] for details: - LIST_TO_TUPLE: convert a list to a tuple, use for constructing lists/tuples in some cases. - LIST_EXTEND: use for constructing lists with unpacking. - SET_UPDATE: use for constructing sets with unpacking. - CONTAINS_OP: check if `a in b` generally useful. When writing tests these op-codes where needed for basic operations and can be safely supported. Add note why dictionary manipulation op-codes have been left out. Also restrict namsepace access to anything with an underscore prefix since these may be undocumented. [0]: https://docs.python.org/3.10/library/dis.html
		
			
				
	
	
		
			37 lines
		
	
	
		
			978 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			978 B
		
	
	
	
		
			C++
		
	
	
	
	
	
/* SPDX-License-Identifier: GPL-2.0-or-later */
 | 
						|
 | 
						|
/** \file
 | 
						|
 * \ingroup pythonintern
 | 
						|
 */
 | 
						|
 | 
						|
#pragma once
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
extern "C" {
 | 
						|
#endif
 | 
						|
 | 
						|
#include <stdbool.h>
 | 
						|
 | 
						|
/**
 | 
						|
 * For faster execution we keep a special dictionary for py-drivers, with
 | 
						|
 * the needed modules and aliases.
 | 
						|
 */
 | 
						|
int bpy_pydriver_create_dict(void);
 | 
						|
/**
 | 
						|
 * For PyDrivers
 | 
						|
 * (drivers using one-line Python expressions to express relationships between targets).
 | 
						|
 */
 | 
						|
extern PyObject *bpy_pydriver_Dict;
 | 
						|
 | 
						|
extern bool BPY_driver_secure_bytecode_test_ex(PyObject *expr_code,
 | 
						|
                                               PyObject *namespace_array[],
 | 
						|
                                               const bool verbose,
 | 
						|
                                               const char *error_prefix);
 | 
						|
extern bool BPY_driver_secure_bytecode_test(PyObject *expr_code,
 | 
						|
                                            PyObject *namespace,
 | 
						|
                                            const bool verbose);
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
}
 | 
						|
#endif
 |