written in a variety of ways:
* Single quotes: ``'allows embedded "double" quotes'``
-* Double quotes: ``"allows embedded 'single' quotes"``.
+* Double quotes: ``"allows embedded 'single' quotes"``
* Triple quoted: ``'''Three single quotes'''``, ``"""Three double quotes"""``
Triple quoted strings may span multiple lines - all associated whitespace will
>>> from keyword import iskeyword
>>> 'hello'.isidentifier(), iskeyword('hello')
- True, False
+ (True, False)
>>> 'def'.isidentifier(), iskeyword('def')
- True, True
+ (True, True)
.. method:: str.islower()
.. index::
single: universal newlines; str.splitlines method
-.. method:: str.splitlines([keepends])
+.. method:: str.splitlines(keepends=False)
Return a list of the lines in the string, breaking at line boundaries. Line
breaks are not included in the resulting list unless *keepends* is given and
literals, except that a ``b`` prefix is added:
* Single quotes: ``b'still allows embedded "double" quotes'``
- * Double quotes: ``b"still allows embedded 'single' quotes"``.
+ * Double quotes: ``b"still allows embedded 'single' quotes"``
* Triple quoted: ``b'''3 single quotes'''``, ``b"""3 double quotes"""``
Only ASCII characters are permitted in bytes literals (regardless of the
pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
'jack', 4127: 'sjoerd'}``, or by the :class:`dict` constructor.
-.. class:: dict(**kwarg)
- dict(mapping, **kwarg)
- dict(iterable, **kwarg)
+.. class:: dict(**kwargs)
+ dict(mapping, **kwargs)
+ dict(iterable, **kwargs)
Return a new dictionary initialized from an optional positional argument
and a possibly empty set of keyword arguments.