@@ -36,13 +36,13 @@ everywhere <http://utf8everywhere.org/>`_.
3636 }
3737 );
3838
39- .. code-block :: python
39+ .. code-block :: pycon
4040
41- >> > utf8_test(' 🎂 ' )
41+ >>> utf8_test("🎂" )
4242 utf-8 is icing on the cake.
4343 🎂
4444
45- >> > utf8_charptr(' 🍕 ' )
45+ >>> utf8_charptr("🍕" )
4646 My favorite food is
4747 🍕
4848
@@ -80,7 +80,7 @@ raise a ``UnicodeDecodeError``.
8080 }
8181 );
8282
83- .. code-block :: python
83+ .. code-block :: pycon
8484
8585 >>> isinstance(example.std_string_return(), str)
8686 True
@@ -114,7 +114,7 @@ conversion has the same overhead as implicit conversion.
114114 }
115115 );
116116
117- .. code-block :: python
117+ .. code-block :: pycon
118118
119119 >>> str_output()
120120 'Send your résumé to Alice in HR'
@@ -143,7 +143,7 @@ returned to Python as ``bytes``, then one can return the data as a
143143 }
144144 );
145145
146- .. code-block :: python
146+ .. code-block :: pycon
147147
148148 >>> example.return_bytes()
149149 b'\xba\xd0\xba\xd0'
@@ -160,7 +160,7 @@ encoding, but cannot convert ``std::string`` back to ``bytes`` implicitly.
160160 }
161161 );
162162
163- .. code-block :: python
163+ .. code-block :: pycon
164164
165165 >>> isinstance(example.asymmetry(b"have some bytes"), str)
166166 True
@@ -229,16 +229,16 @@ character.
229229 m.def("pass_char", [](char c) { return c; });
230230 m.def("pass_wchar", [](wchar_t w) { return w; });
231231
232- .. code-block :: python
232+ .. code-block :: pycon
233233
234- >> > example.pass_char(' A ' )
234+ >>> example.pass_char("A" )
235235 'A'
236236
237237 While C++ will cast integers to character types (``char c = 0x65; ``), pybind11
238238does not convert Python integers to characters implicitly. The Python function
239239``chr() `` can be used to convert integers to characters.
240240
241- .. code-block :: python
241+ .. code-block :: pycon
242242
243243 >>> example.pass_char(0x65)
244244 TypeError
@@ -259,17 +259,17 @@ a combining acute accent). The combining character will be lost if the
259259two-character sequence is passed as an argument, even though it renders as a
260260single grapheme.
261261
262- .. code-block :: python
262+ .. code-block :: pycon
263263
264- >> > example.pass_wchar(' é ' )
264+ >>> example.pass_wchar("é" )
265265 'é'
266266
267- >> > combining_e_acute = ' e ' + ' \u0301 '
267+ >>> combining_e_acute = "e" + " \u0301"
268268
269269 >>> combining_e_acute
270270 'é'
271271
272- >> > combining_e_acute == ' é '
272+ >>> combining_e_acute == "é"
273273 False
274274
275275 >>> example.pass_wchar(combining_e_acute)
@@ -278,9 +278,9 @@ single grapheme.
278278 Normalizing combining characters before passing the character literal to C++
279279may resolve *some * of these issues:
280280
281- .. code-block :: python
281+ .. code-block :: pycon
282282
283- >> > example.pass_wchar(unicodedata.normalize(' NFC' , combining_e_acute))
283+ >>> example.pass_wchar(unicodedata.normalize(" NFC" , combining_e_acute))
284284 'é'
285285
286286 In some languages (Thai for example), there are `graphemes that cannot be
0 commit comments