unreal.PyTestTypeHint

class unreal.PyTestTypeHint(outer: Object | None = None, name: Name | str = 'None')

Bases: Object

Used to verify if the generated Python stub is correctly type-hinted (if type hint is enabled). The stub is generated in the project intermediate folder when the Python developer mode is enabled (Editor preferences). The type hints can be checked in the stub itself or PythonScriptPlugin/Content/Python/test_type_hints.py can be loaded in a Python IDE that supports type checking and look at the code to verify that there is not problems with the types.

C++ Source:

  • Plugin: PythonScriptPlugin

  • Module: PythonScriptPlugin

  • File: PyTest.h

Editor Properties: (see get_editor_property/set_editor_property)

  • bool_prop (bool): [Read-Write] Check type hinted properties (setter/getter)

  • delegate_prop (PyTestDelegate): [Read-Write]

  • enum_prop (PyTestEnum): [Read-Write]

  • field_path_prop (FieldPath): [Read-Write]

  • float_prop (float): [Read-Write]

  • int_prop (int32): [Read-Write]

  • map_prop (Map[int32, str]): [Read-Write]

  • multicast_delegate_prop (PyTestMulticastDelegate): [Read-Write]

  • name_array_prop (Array[Name]): [Read-Write]

  • name_prop (Name): [Read-Write]

  • object_array_prop (Array[Object]): [Read-Write]

  • object_prop (PyTestObject): [Read-Write]

  • set_prop (Set[str]): [Read-Write]

  • slate_tick_delegate (PyTestSlateTickDelegate): [Read-Write] Members to facilitate testing particular Python API.

  • str_array_prop (Array[str]): [Read-Write]

  • string_prop (str): [Read-Write]

  • struct_prop (PyTestStruct): [Read-Write]

  • text_array_prop (Array[Text]): [Read-Write]

  • text_prop (Text): [Read-Write]

INT_CONST: int

Get Int Const

Type:

(int32)

STR_CONST: str

Check type hinted constants

Type:

(str)

property bool_prop: bool

[Read-Write] Check type hinted properties (setter/getter)

Type:

(bool)

check_array_type_hints(param1, param2, param3, param4) Array[Text]

Check Array Type Hints

Parameters:
Return type:

Array[Text]

check_bool_type_hints(param1, param2=True, param3=False) bool

Check type hinted methods.

Parameters:
Return type:

bool

check_delegate_type_hints(param1) PyTestDelegate

Check Delegate Type Hints

Parameters:

param1 (PyTestDelegate)

Return type:

PyTestDelegate

check_enum_type_hints(param1, param2=PyTestEnum.ONE) PyTestEnum

Check Enum Type Hints

Parameters:
Return type:

PyTestEnum

check_field_path_type_hints(param1) FieldPath

Check Field Path Type Hints

Parameters:

param1 (FieldPath)

Return type:

FieldPath

check_float_type_hints(param1, param2, param3=-3.300000, param4=4.400000) double

Check Float Type Hints

Parameters:
  • param1 (float)

  • param2 (double)

  • param3 (float)

  • param4 (double)

Return type:

double

check_integer_type_hints(param1, param2=4, param3=5) int32

Check Integer Type Hints

Parameters:
  • param1 (uint8)

  • param2 (int32)

  • param3 (int64)

Return type:

int32

check_map_type_hints(param1, param2, param3, param4) Map[str, Object]

Check Map Type Hints

Parameters:
Return type:

Map[str, Object]

check_name_type_hints(param1, param2='Hi') Name

Check Name Type Hints

Parameters:
Return type:

Name

check_object_type_hints(param1, param4=None) PyTestObject

Check Object Type Hints

Parameters:
Return type:

PyTestObject

check_set_type_hints(param1, param2, param3) Set[Name]

Check Set Type Hints

Parameters:
Return type:

Set[Name]

classmethod check_static_function(param1, param2, param3, param4) bool

Check Static Function

Parameters:
  • param1 (bool)

  • param2 (int32)

  • param3 (double)

  • param4 (str)

Return type:

bool

check_string_type_hints(param1, param2='Hi') str

Check String Type Hints

Parameters:
Return type:

str

check_struct_type_hints(param1, param2=[False, 0, 0.000000, PyTestEnum.ONE, '', 'None', '', FieldPath(), FieldPath(), [], [], {}, False, None, None]) PyTestStruct

Check Struct Type Hints

Parameters:
Return type:

PyTestStruct

check_text_type_hints(param1, param2='Hi') Text

Check Text Type Hints

Parameters:
Return type:

Text

classmethod check_tuple_return_type(out_string) -> (int32, out_string=str)

Check Tuple Return Type

Parameters:

out_string (str)

Returns:

out_string (str):

Return type:

str

property delegate_prop: PyTestDelegate

[Read-Write]

Type:

(PyTestDelegate)

property enum_prop: PyTestEnum

[Read-Write]

Type:

(PyTestEnum)

property field_path_prop: FieldPath

[Read-Write]

Type:

(FieldPath)

property float_prop: float

[Read-Write]

Type:

(float)

property int_prop: int

[Read-Write]

Type:

(int32)

property map_prop: None

[Read-Write]

Type:

(Map[int32, str])

property multicast_delegate_prop: PyTestMulticastDelegate

[Read-Write]

Type:

(PyTestMulticastDelegate)

property name_array_prop: None

[Read-Write]

Type:

(Array[Name])

property name_prop: Name

[Read-Write]

Type:

(Name)

property object_array_prop: None

[Read-Write]

Type:

(Array[Object])

property object_prop: PyTestObject

[Read-Write]

Type:

(PyTestObject)

property set_prop: None

[Read-Write]

Type:

(Set[str])

property slate_tick_delegate: PyTestSlateTickDelegate

[Read-Write] Members to facilitate testing particular Python API.

Type:

(PyTestSlateTickDelegate)

property str_array_prop: None

[Read-Write]

Type:

(Array[str])

property string_prop: str

[Read-Write]

Type:

(str)

property struct_prop: PyTestStruct

[Read-Write]

Type:

(PyTestStruct)

property text_array_prop: None

[Read-Write]

Type:

(Array[Text])

property text_prop: Text

[Read-Write]

Type:

(Text)