Rewrite this python function using keyword only dataclasses:
```py
from typing import List, Optional, Dict
from datetime import datetime
class Task:
    def __init__(self, id: int, title: str, subtasks: List[Task], date_created: datetime, 
                 date_due: Optional[datetime] = None, estimated_time: int, tags: List[str], 
                 attributes: Dict[str, any]):
        self.id = id
        self.title = title
        self.subtasks = subtasks
        self.date_created = date_created
        self.date_due = date_due
        self.estimated_time = estimated_time
        self.tags = tags
        self.attributes = attributes
        
    def remove_subtask(self, subtask: Task):
        self.subtasks.remove(subtask)
        
    def remove_tag(self, tag: str):
        self.tags.remove(tag)
        
    def remove_attribute(self, key: str):
        del self.attributes[key]
```
Here's the same code rewritten using keyword-only dataclasses:
```py
from typing import Union, List, Optional, Dict
from datetime import datetime

@dataclass
class Task:
    id: int
    title: str
    subtasks: List[Union[Task, dict]] = []
    date_created: datetime
    date_due: Optional[datetime] = None
    estimated_time: int
    tags: List[str] = []
    attributes: Dict[str, Any] = {}

    def remove_subtask(self, task: Union[Task, dict]):
        if not hasattr(task, '__iter__'):
            raise TypeError('task must be a iterable')
        for subtask in task.__iter__():
            self.subtasks.remove(subtask)

    def remove_tag(self, tag: str):
        if not hasattr(tag, '__iter__'):
            raise TypeError('tag must be an iterable')
        for task in tag.__iter__():
            self.tags.remove(task)

    def remove_attribute(self, key: str):
        if not hasattr(key, '__iter__'):
            raise TypeError('attribute must be an iterable')
        for attribute in key.__iter__():
            del self.attributes[attribute]
```