Dalba added a comment.

There are some packages like wcwidth that can detect the display width of a line, but even them are not 100% accurate. The real display width depends on other factros like user's installed fonts and unicode version. There are also some characters that when put next to each other form a typographic ligature and the width of them changes.

According to these complications I'd suggest closing this task as declined. Other linting libraries like pylint also use len(line). In problematic cases one can use Python's escape sequences (\xhh \uxxxx \Uxxxxxxxx).


TASK DETAIL
https://phabricator.wikimedia.org/T202189

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Dalba
Cc: Framawiki, Aklapper, Dalba, Xqt, pywikibot-bugs-list, Tbscho, MayS, Mdupont, JJMC89, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to