Skip to content

fix(pcan): swap SetValue and GetErrorText docstrings#2058

Open
SAY-5 wants to merge 1 commit into
hardbyte:mainfrom
SAY-5:fix/pcan-setvalue-geterrortext-docstrings
Open

fix(pcan): swap SetValue and GetErrorText docstrings#2058
SAY-5 wants to merge 1 commit into
hardbyte:mainfrom
SAY-5:fix/pcan-setvalue-geterrortext-docstrings

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 12, 2026

Fixes #2047.

In can/interfaces/pcan/basic.py, the docstrings (and the preceding # Returns a descriptive text... C-style comment) on SetValue and GetErrorText were swapped:

  • SetValue (line 996) described "Returns a descriptive text of a given TPCANStatus error code".
  • GetErrorText (line 1038) described "Configures or sets a PCAN Channel value".

Both functions' implementations are correct; only the docstrings disagreed with the code. This swap restores each docstring to its matching function, so help(PCANBasic.SetValue) and help(PCANBasic.GetErrorText) describe what they actually do.

Verified locally: python -c "from can.interfaces.pcan.basic import PCANBasic; help(PCANBasic.SetValue)" now reports "Configures or sets a PCAN Channel value".

The docstrings for SetValue and GetErrorText in pcan/basic.py were
swapped: SetValue described returning an error text and GetErrorText
described configuring a channel value. Swap them so each docstring
matches its function.

Fixes hardbyte#2047
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docstrings for SetValue and GetErrorText are swapped

1 participant