File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed
Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ Alternatively, the package can be installed manually in both editors:
3737- enjoy.
3838
3939
40+ ## Screenshot
41+
42+ ![ ] ( https://magicstack.github.io/MagicPython/example.png )
43+
44+
4045## Changes and Improvements
4146
4247Overall, the central idea is that it should be easy to notice something odd or
Original file line number Diff line number Diff line change 1+ import asyncio
2+
3+
4+ def showcase ():
5+ """Some code to showcase the syntax.
6+
7+ Docstrings are recognized and have an additional scope.
8+ Color schemas can render them differently from other strings.
9+
10+ HACK doctests are highlighted too.
11+
12+ >>> print('''hello
13+ ... world''')
14+ """
15+
16+ @decorator (param = 'spam' )
17+ async def coroutine (db :aio_db .DatabaseConnection ) -> List [str ]:
18+ r"""A coroutine."""
19+
20+ await logger .log ('working\x12 with %r' , aio_db )
21+
22+ async with db .transaction ():
23+ print ('Result: {result!r}' .format (result =
24+ await db .query (...)))
25+
26+ # a regular expression
27+ get_regex = lambda : re .compile (
28+ r"""\A
29+ word
30+ (?: # a comment
31+ (?P<fill>.)?
32+ (?P<align>[<>=^]) (?# another comment)
33+ )?
34+ another word\.\.\.
35+ (?:\.(?P<precision>0|(?!0)\d+))?
36+ \Z""" ,
37+ re .VERBOSE | re .DOTALL )
38+
39+ # NOTE Numbers with leading zeroes are invalid in Python3,
40+ # use 0o...
41+ answer = func (0xdeadbeef + 0b0010001 + 0123 + 0o123 +
42+ # complex numbers
43+ .10e12 + 2j ) @ mat
44+
45+ raw_string = R'''No escapes '\' in this \one'''
46+
47+ return NotImplemented
You can’t perform that action at this time.
0 commit comments