Skip to content

Commit

Permalink
Fix MDX compilation error on { and } by replacing with \{ and \}, res…
Browse files Browse the repository at this point in the history
…pectively
  • Loading branch information
smortezah committed Nov 24, 2024
1 parent 8c267ed commit 856f5de
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions website/docs/python/builtin_advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ data = dict(zip(keys, values))
print(data)
```

{'name': 'Alice', 'age': 30, 'city': 'New York'}
\{'name': 'Alice', 'age': 30, 'city': 'New York'\}

This is a common pattern when working with data transformations.

Expand Down Expand Up @@ -223,7 +223,7 @@ fruit_dict = {index: fruit for index, fruit in enumerate(fruits)}
print(fruit_dict)
```

{0: 'Apple', 1: 'Banana', 2: 'Cherry'}
\{0: 'Apple', 1: 'Banana', 2: 'Cherry'\}

This pattern is useful for transforming lists into indexed data structures.

Expand Down Expand Up @@ -647,7 +647,7 @@ adults = filter(lambda person: person["age"] > 18, people)
print(list(adults))
```

[{'name': 'Alice', 'age': 25}, {'name': 'Charlie', 'age': 30}]
[\{'name': 'Alice', 'age': 25\}, \{'name': 'Charlie', 'age': 30\}]

### Example 6: Using `filter` with Generators

Expand Down Expand Up @@ -777,7 +777,7 @@ transformed = map(lambda person: {**person, "name": person["name"].capitalize()}
print(list(transformed))
```

[{'name': 'Alice', 'age': 25}, {'name': 'Bob', 'age': 30}]
[\{'name': 'Alice', 'age': 25\}, \{'name': 'Bob', 'age': 30\}]

This is particularly useful for preprocessing data in pipelines.

Expand Down Expand Up @@ -1847,7 +1847,7 @@ person = Person("Alice", 30)
print(vars(person))
```

{'name': 'Alice', 'age': 30}
\{'name': 'Alice', 'age': 30\}

This is especially helpful for debugging or logging purposes.

Expand All @@ -1863,7 +1863,7 @@ vars(person)["city"] = "New York"
print(vars(person))
```

{'name': 'Alice', 'age': 31, 'city': 'New York'}
{'name': 'Alice', 'age': 31, 'city': 'New York'\}

### Restrictions and Best Practices

Expand Down Expand Up @@ -2021,7 +2021,7 @@ evaluated_config = {key: eval(value) for key, value in config.items()}
print(evaluated_config)
```

{'threshold': 15, 'scale_factor': 6.28}
\{'threshold': 15, 'scale_factor': 6.28\}

### Tips for Using `eval` Safely

Expand Down

0 comments on commit 856f5de

Please sign in to comment.