Skip to content

Commit 38b3719

Browse files
committed
Fix docs
1 parent 0949578 commit 38b3719

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docs/docs/python-sdk/guides/python-typing.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This guide explains how to use Python's type system effectively with the Infrahu
99
:::note What is Python Typing
1010

1111
Python typing allows you to specify the expected data types of variables, function arguments, and return values to improve code clarity and catch bugs early.
12+
1213
```python
1314
# Basic type hints
1415
def percentage(num1: int, num2: int) -> float:
@@ -17,14 +18,14 @@ def percentage(num1: int, num2: int) -> float:
1718

1819
:::
1920

20-
## Leveraging Python Protocols
21+
## Leveraging Python protocols
2122

22-
The Python SDK for Infrahub has been designed to automatically work with any schemas loaded into Infrahub.
23+
The Python SDK for Infrahub has been designed to automatically work with any schemas loaded into Infrahub.
2324
Internally, the Python SDK generates dynamic Python representations of your schemas.
2425

2526
While this approach improves code readability, it presents challenges with type checking because each object has a different signature based on your schema.
2627

27-
### Without Protocols
28+
### Without protocols
2829

2930
In the example below, type checkers like Mypy will typically complain about `blue_tag.description.value` because `description` is a dynamic parameter generated by the SDK.
3031

@@ -35,7 +36,7 @@ blue_tag.description.value = "The blue tag" # Mypy: error: "InfrahubNode" has n
3536
blue_tag.save()
3637
```
3738

38-
### With Protocols
39+
### With protocols
3940

4041
To provide strict type checking while maintaining platform extensibility, the Python SDK integrates with Python Protocols.
4142

@@ -57,7 +58,7 @@ Python Protocols, introduced in PEP 544, define a set of method and property sig
5758

5859
:::
5960

60-
## Generating Custom Protocols based on your schema
61+
## Generating custom protocols based on your schema
6162

6263
You can generate Python Protocols for your own models using the `infrahubctl protocols` command. This supports both synchronous and asynchronous Python code.
6364

0 commit comments

Comments
 (0)