Skip to content

Commit

Permalink
Suggest not to use the n argument
Browse files Browse the repository at this point in the history
  • Loading branch information
jquast committed Dec 15, 2023
1 parent 075417a commit c92dde7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wcwidth/wcwidth.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ def wcswidth(pwcs, n=None, unicode_version='auto'):
: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 only the first ``n`` characters are measured.
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 c92dde7

Please sign in to comment.