argosopentech / argosopentech/translate-html

Incorrect return type annotation in `translate_html` function

Open
#18 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
60
Forks
11
PR merge metrics
No merged PRs in 30d

Description

**Description**
The return type annotation for the `translate_html` function incorrectly states it returns a `str`, but the actual return value is a `BeautifulSoup` object.

**Problem Details**
The function's docstring specifies the return type as `str`:
```python
def translate_html(...):
...
return translated_soup # This is a BeautifulSoup object, not a string
```

However, the code returns a `BeautifulSoup` instance created via `soup_of_itag(translated_tag)`. This discrepancy may cause confusion for users expecting a string output.

**Suggested Fix**
Update the return type annotation to reflect the actual `BeautifulSoup` return value:
```diff
- Returns:
- str: Translated HTML string
+ Returns:
+ BeautifulSoup: Translated HTML as a BeautifulSoup object
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the `translate_html` function and inspect its docstring and the `soup_of_itag(translated_tag)` return path. Update the documented return type and description to match the returned `BeautifulSoup` object, then verify the documentation or relevant checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.