-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaper.py
38 lines (33 loc) · 1.01 KB
/
paper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from dataclasses import dataclass
from typing import List
@dataclass
class Paper:
"""
Represents a research paper with its metadata.
Attributes:
title: Paper title
authors: List of author names
abstract: Paper abstract
url: Link to the paper (optional)
venue: Publication venue (optional)
"""
title: str
authors: List[str]
abstract: str
url: str = "" # Optional URL to the paper
venue: str = "" # Optional publication venue
def __init__(
self,
title: str,
authors: List[str],
abstract: str,
url: str = "",
venue: str = "",
):
"""Initialize Paper object with immutable attributes."""
# Use object.__setattr__ because class is frozen
object.__setattr__(self, "title", title)
object.__setattr__(self, "authors", authors)
object.__setattr__(self, "abstract", abstract)
object.__setattr__(self, "url", url)
object.__setattr__(self, "venue", venue)