Marks a safe string as being inline when used with other Script APIs. Non-inlined strings will remain strings when used with any of these APIs. For example: :: >>> make_invocable("print", safe("example")) "print('example')" >>> make_invocable("print", inlin
(inp)
| 76 | |
| 77 | @mod.export() |
| 78 | def inline(inp): |
| 79 | """ |
| 80 | Marks a safe string as being inline when used with other Script APIs. |
| 81 | Non-inlined strings will remain strings when used with any of these APIs. |
| 82 | For example: |
| 83 | :: |
| 84 | |
| 85 | >>> make_invocable("print", safe("example")) |
| 86 | "print('example')" |
| 87 | |
| 88 | >>> make_invocable("print", inline(safe("example"))) |
| 89 | "print(example)" |
| 90 | |
| 91 | Args: |
| 92 | inp (Script.String): The safe string to inline. |
| 93 | """ |
| 94 | inp = ensure_safe(inp) |
| 95 | inp.inline = True |
| 96 | return inp |
| 97 | |
| 98 | |
| 99 | def make_invocable_impl(type_str, *args, **kwargs): |