In regex, what does [\w*] mean?

Quick answer: ^[\w*]$ will match a string consisting of a single character, where that character is alphanumeric (letters, numbers) an underscore (_) or an asterisk (*). Details: The “\w” means “any word character” which usually means alphanumeric (letters, numbers, regardless of case) plus underscore (_) The “^” “anchors” to the beginning of a string, and … Read more

Python – is there a “don’t care” symbol for tuple assignments?

_ is indeed a very popular choice for “a name which doesn’t matter” — it’s a legal name, visually unobtrusive, etc. However sometimes these very qualities can hinder you. For example, the GNU gettext module for I18N and L10N, which is part of Python’s standard library, idiomatically uses _ very differently, with idioms such as…: … Read more