Skip to content

Commit

Permalink
spellfix about n argument (#108)
Browse files Browse the repository at this point in the history
* spellfix about ``n`` argument

nobody should be using this argument, anyway! Its a holdover from
the C POSIX function signature

* Suggest not to use the ``n`` argument
  • Loading branch information
jquast authored Dec 15, 2023
1 parent 076164e commit 0ba0278
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions wcwidth/wcwidth.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,11 @@ def wcswidth(pwcs, n=None, unicode_version='auto'):
Given a unicode string, return its printable length on a terminal.
:param str pwcs: Measure width of given unicode string.
:param int n: When ``n`` is None (default), return the length of the
entire string, otherwise width the first ``n`` characters specified.
:param int n: When ``n`` is None (default), return the length of the entire
string, otherwise only the first ``n`` characters are measured. This
argument exists only for compatibility with the C POSIX function
signature. It is suggested instead to use python's string slicing
capability, ``wcswidth(pwcs[:n])``
:param str unicode_version: An explicit definition of the unicode version
level to use for determination, may be ``auto`` (default), which uses
the Environment Variable, ``UNICODE_VERSION`` if defined, or the latest
Expand Down

0 comments on commit 0ba0278

Please sign in to comment.