created initial textnode class

This commit is contained in:
John O'Keefe 2024-03-18 19:19:50 -04:00
parent 6ecab09dcc
commit b384d89175

15
src/textnode.py Normal file
View File

@ -0,0 +1,15 @@
class TextNode:
def __init__(self, text, text_type, url=None) -> None:
self.text = text
self.text_type = text_type
self.url = url
def __eq__(self, other_node) -> bool:
return (
self.text == other_node.text
and self.text_type == other_node.text_type
and self.url == other_node.url
)
def __repr__(self) -> str:
return f"TextNode({self.text}, {self.text_type}, {self.url})"