File: codeblock.txt

package info (click to toggle)
python-sybil 9.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,148 kB
  • sloc: python: 4,510; makefile: 90
file content (59 lines) | stat: -rw-r--r-- 982 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
This is a code block:

.. code-block:: python

  y += 1

After this text is a code block that goes boom:

.. code-block:: python

  raise Exception('boom!')

Now we have an invisible code block, great for setting things up or checking
stuff within a doc:


.. invisible-code-block: python

  z += 1

This paranoidly checks that we can use binary and unicode literals:

.. code-block:: python

  bin = b'x'
  uni = u'x'

- Here's a code block that should still be found!:

  .. code-block:: python

    class NoVars:
         __slots__ = ['x']

  This one has some text after it that also forms part of the bullet.

- Another bullet:

  .. code-block:: python

    define_this = 1

- A following bullet straight away!

- A code block in a non-python language:

  .. code-block:: lolcode

    HAI
    CAN HAS STDIO?
    VISIBLE "HAI WORLD!"
    KTHXBYE

- Here's another code block that should still be found!:

  .. code-block:: python

    class YesVars:
         __slots__ = ['x']