Debian Codegraph @

third_party/rust/uniffi_bindgen/src/bindings/python/templates/README.md

raw
1 # Rules for the Python template code
2
3 ## Naming
4
5 Private variables, classes, functions, etc. should be prefixed with `_uniffi`, `_Uniffi`, or `_UNIFFI`.
6 The `_` indicates the variable is private and removes it from the autocomplete list.
7 The `uniffi` part avoids naming collisions with user-defined items.
8 Users can use leading underscores in their names if they want, but "uniffi" is reserved for our purposes.
9
10 In particular, make sure to use the `_uniffi` prefix for any variable names in generated functions.
11 If you name a variable something like `result` the code will probably work initially.
12 Then it will break later on when a user decides to define a function with a parameter named `result`.
13
14 Note: this doesn't apply to items that we want to expose, for example users may want to catch `InternalError` so doesn't get the `Uniffi` prefix.