| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2612,7 +2612,9 @@ expression support in the :mod:`re` module). | |||
| 2612 | 2612 | :func:`re.split`). Splitting an empty string with a specified separator | |
| 2613 | 2613 | returns ``['']``. | |
| 2614 | 2614 | ||
| 2615 | - For example:: | ||
| 2615 | + For example: | ||
| 2616 | + | ||
| 2617 | + .. doctest:: | ||
| 2616 | 2618 | ||
| 2617 | 2619 | >>> '1,2,3'.split(',') | |
| 2618 | 2620 | ['1', '2', '3'] | |
@@ -2630,7 +2632,9 @@ expression support in the :mod:`re` module). | |||
| 2630 | 2632 | string or a string consisting of just whitespace with a ``None`` separator | |
| 2631 | 2633 | returns ``[]``. | |
| 2632 | 2634 | ||
| 2633 | - For example:: | ||
| 2635 | + For example: | ||
| 2636 | + | ||
| 2637 | + .. doctest:: | ||
| 2634 | 2638 | ||
| 2635 | 2639 | >>> '1 2 3'.split() | |
| 2636 | 2640 | ['1', '2', '3'] | |
@@ -2642,7 +2646,9 @@ expression support in the :mod:`re` module). | |||
| 2642 | 2646 | If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only | |
| 2643 | 2647 | leading runs of consecutive whitespace are considered. | |
| 2644 | 2648 | ||
| 2645 | - For example:: | ||
| 2649 | + For example: | ||
| 2650 | + | ||
| 2651 | + .. doctest:: | ||
| 2646 | 2652 | ||
| 2647 | 2653 | >>> "".split(None, 0) | |
| 2648 | 2654 | [] | |
@@ -2651,7 +2657,7 @@ expression support in the :mod:`re` module). | |||
| 2651 | 2657 | >>> " foo ".split(maxsplit=0) | |
| 2652 | 2658 | ['foo '] | |
| 2653 | 2659 | ||
| 2654 | - See also :meth:`join`. | ||
| 2660 | + See also :meth:`join` and :meth:`rsplit`. | ||
| 2655 | 2661 | ||
| 2656 | 2662 | ||
| 2657 | 2663 | .. index:: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments