-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for π Python objects to be updated in README
feat: Add support for π Python objects to be updated in README
- Loading branch information
Showing
7 changed files
with
332 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import re | ||
|
||
|
||
# Function verifying an email is valid | ||
def verify_email(email: str) -> bool: | ||
return re.match(r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$", email) is not None | ||
|
||
|
||
class Person: | ||
def __init__(self, name: str, age: int): | ||
self.name = name | ||
self.age = age | ||
|
||
# String representation of the class | ||
def __str__(self) -> str: | ||
return f"Person(name={self.name}, age={self.age})" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# README 3 | ||
|
||
This is a test README file for testing the code embedding process. | ||
|
||
## Python objects | ||
|
||
This section contains examples of Python objects. | ||
|
||
```python:tests/data/example_python_objects.py:verify_email | ||
def verify_email(email: str) -> bool: | ||
return re.match(r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$", email) is not None | ||
``` | ||
|
||
```python:tests/data/example_python_objects.py:Person | ||
class Person: | ||
def __init__(self, name: str, age: int): | ||
self.name = name | ||
self.age = age | ||
# String representation of the class | ||
def __str__(self) -> str: | ||
return f"Person(name={self.name}, age={self.age})" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# README 3 | ||
|
||
This is a test README file for testing the code embedding process. | ||
|
||
## Python objects | ||
|
||
This section contains examples of Python objects. | ||
|
||
```python:tests/data/example_python_objects.py:verify_email | ||
``` | ||
|
||
```python:tests/data/example_python_objects.py:Person | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.