construction of tuples containing 0 or 1 items

construction of tuples containing 0 or 1 items

  the syntax has some extra quirks to accommodate these. Empty tuples are constructed by an empty pair of parentheses; a tuple with one item is constructed by following a value with a comma (it is not sufficient to enclose a single value in parentheses). Ugly, but effective. For example:

  

原文地址:https://www.cnblogs.com/tekkaman/p/5712259.html