Skip to content

Commit 1d2276d

Browse files
authored
Merge branch 'master' into fix-tox-config-file-coverage-report
2 parents dc3b890 + d2f9fcf commit 1d2276d

File tree

10 files changed

+408
-25
lines changed

10 files changed

+408
-25
lines changed

docs/conf.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# RestrictedPython documentation build configuration file, created by
43
# sphinx-quickstart on Thu May 19 12:43:20 2016.
@@ -47,18 +46,18 @@
4746
master_doc = 'index'
4847

4948
# General information about the project.
50-
project = u'RestrictedPython'
51-
copyright = u'2017-2020, Zope Foundation and Contributors'
52-
author = u'The Zope developer community'
49+
project = 'RestrictedPython'
50+
copyright = '2017-2022, Zope Foundation and Contributors'
51+
author = 'The Zope developer community'
5352

5453
# The version info for the project you're documenting, acts as replacement for
5554
# |version| and |release|, also used in various other places throughout the
5655
# built documents.
5756
#
5857
# The short X.Y version.
59-
version = u'5.0'
58+
version = '5.0'
6059
# The full version, including alpha/beta/rc tags.
61-
release = u'5.0'
60+
release = '5.0'
6261

6362
# The language for content autogenerated by Sphinx. Refer to documentation
6463
# for a list of supported languages.
@@ -240,8 +239,8 @@
240239
# (source start file, target name, title,
241240
# author, documentclass [howto, manual, or own class]).
242241
latex_documents = [
243-
(master_doc, 'RestrictedPython.tex', u'RestrictedPython Documentation',
244-
u'Alexander Loechel', 'manual'),
242+
(master_doc, 'RestrictedPython.tex', 'RestrictedPython Documentation',
243+
'Alexander Loechel', 'manual'),
245244
]
246245

247246
# The name of an image file (relative to this directory) to place at the top of
@@ -270,7 +269,7 @@
270269
# One entry per manual page. List of tuples
271270
# (source start file, name, description, authors, manual section).
272271
man_pages = [
273-
(master_doc, 'restrictedpython', u'RestrictedPython Documentation',
272+
(master_doc, 'restrictedpython', 'RestrictedPython Documentation',
274273
[author], 1)
275274
]
276275

@@ -284,7 +283,7 @@
284283
# (source start file, target name, title, author,
285284
# dir menu entry, description, category)
286285
texinfo_documents = [
287-
(master_doc, 'RestrictedPython', u'RestrictedPython Documentation',
286+
(master_doc, 'RestrictedPython', 'RestrictedPython Documentation',
288287
author, 'RestrictedPython', 'One line description of project.',
289288
'Miscellaneous'),
290289
]

docs/contributing/ast/python3_10.ast

+184
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
-- Python 3.10 AST
2+
-- ASDL's 4 builtin types are:
3+
-- identifier, int, string, constant
4+
5+
module Python version "3.10"
6+
{
7+
mod = Module(stmt* body, type_ignore* type_ignores)
8+
| Interactive(stmt* body)
9+
| Expression(expr body)
10+
| FunctionType(expr* argtypes, expr returns)
11+
12+
stmt = FunctionDef(identifier name,
13+
arguments args,
14+
stmt* body,
15+
expr* decorator_list,
16+
expr? returns,
17+
string? type_comment)
18+
| AsyncFunctionDef(identifier name,
19+
arguments args,
20+
stmt* body,
21+
expr* decorator_list,
22+
expr? returns,
23+
string? type_comment)
24+
25+
| ClassDef(identifier name,
26+
expr* bases,
27+
keyword* keywords,
28+
stmt* body,
29+
expr* decorator_list)
30+
| Return(expr? value)
31+
32+
| Delete(expr* targets)
33+
| Assign(expr* targets, expr value, string? type_comment)
34+
| AugAssign(expr target, operator op, expr value)
35+
-- 'simple' indicates that we annotate simple name without parens
36+
| AnnAssign(expr target, expr annotation, expr? value, int simple)
37+
38+
-- use 'orelse' because else is a keyword in target languages
39+
| For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)
40+
| AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)
41+
| While(expr test, stmt* body, stmt* orelse)
42+
| If(expr test, stmt* body, stmt* orelse)
43+
| With(withitem* items, stmt* body, string? type_comment)
44+
| AsyncWith(withitem* items, stmt* body, string? type_comment)
45+
46+
| Match(expr subject, match_case* cases)
47+
48+
| Raise(expr? exc, expr? cause)
49+
| Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)
50+
| Assert(expr test, expr? msg)
51+
52+
| Import(alias* names)
53+
| ImportFrom(identifier? module, alias* names, int? level)
54+
55+
| Global(identifier* names)
56+
| Nonlocal(identifier* names)
57+
| Expr(expr value)
58+
| Pass
59+
| Break
60+
| Continue
61+
62+
-- col_offset is the byte offset in the utf8 string the parser uses
63+
attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)
64+
65+
-- BoolOp() can use left & right?
66+
expr = BoolOp(boolop op, expr* values)
67+
| NamedExpr(expr target, expr value)
68+
| BinOp(expr left, operator op, expr right)
69+
| UnaryOp(unaryop op, expr operand)
70+
| Lambda(arguments args, expr body)
71+
| IfExp(expr test, expr body, expr orelse)
72+
| Dict(expr* keys, expr* values)
73+
| Set(expr* elts)
74+
| ListComp(expr elt, comprehension* generators)
75+
| SetComp(expr elt, comprehension* generators)
76+
| DictComp(expr key, expr value, comprehension* generators)
77+
| GeneratorExp(expr elt, comprehension* generators)
78+
-- the grammar constrains where yield expressions can occur
79+
| Await(expr value)
80+
| Yield(expr? value)
81+
| YieldFrom(expr value)
82+
-- need sequences for compare to distinguish between
83+
-- x < 4 < 3 and (x < 4) < 3
84+
| Compare(expr left, cmpop* ops, expr* comparators)
85+
| Call(expr func, expr* args, keyword* keywords)
86+
| FormattedValue(expr value, int conversion, expr? format_spec)
87+
| JoinedStr(expr* values)
88+
| Constant(constant value, string? kind)
89+
90+
-- the following expression can appear in assignment context
91+
| Attribute(expr value, identifier attr, expr_context ctx)
92+
| Subscript(expr value, expr slice, expr_context ctx)
93+
| Starred(expr value, expr_context ctx)
94+
| Name(identifier id, expr_context ctx)
95+
| List(expr* elts, expr_context ctx)
96+
| Tuple(expr* elts, expr_context ctx)
97+
98+
-- can appear only in Subscript
99+
| Slice(expr? lower, expr? upper, expr? step)
100+
101+
-- col_offset is the byte offset in the utf8 string the parser uses
102+
attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)
103+
104+
expr_context = Load
105+
| Store
106+
| Del
107+
108+
boolop = And
109+
| Or
110+
111+
operator = Add
112+
| Sub
113+
| Mult
114+
| MatMult
115+
| Div
116+
| Mod
117+
| Pow
118+
| LShift
119+
| RShift
120+
| BitOr
121+
| BitXor
122+
| BitAnd
123+
| FloorDiv
124+
125+
unaryop = Invert
126+
| Not
127+
| UAdd
128+
| USub
129+
130+
cmpop = Eq
131+
| NotEq
132+
| Lt
133+
| LtE
134+
| Gt
135+
| GtE
136+
| Is
137+
| IsNot
138+
| In
139+
| NotIn
140+
141+
comprehension = (expr target, expr iter, expr* ifs, int is_async)
142+
143+
excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)
144+
attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)
145+
146+
arguments = (arg* posonlyargs,
147+
arg* args,
148+
arg? vararg,
149+
arg* kwonlyargs,
150+
expr* kw_defaults,
151+
arg? kwarg,
152+
expr* defaults)
153+
154+
arg = (identifier arg, expr? annotation, string? type_comment)
155+
attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)
156+
157+
-- keyword arguments supplied to call (NULL identifier for **kwargs)
158+
keyword = (identifier? arg, expr value)
159+
attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)
160+
161+
-- import name with optional 'as' alias.
162+
alias = (identifier name, identifier? asname)
163+
attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)
164+
165+
withitem = (expr context_expr, expr? optional_vars)
166+
167+
match_case = (pattern pattern, expr? guard, stmt* body)
168+
169+
pattern = MatchValue(expr value)
170+
| MatchSingleton(constant value)
171+
| MatchSequence(pattern* patterns)
172+
| MatchMapping(expr* keys, pattern* patterns, identifier? rest)
173+
| MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, pattern* kwd_patterns)
174+
175+
| MatchStar(identifier? name)
176+
-- The optional "rest" MatchMapping parameter handles capturing extra mapping keys
177+
178+
| MatchAs(pattern? pattern, identifier? name)
179+
| MatchOr(pattern* patterns)
180+
181+
attributes (int lineno, int col_offset, int end_lineno, int end_col_offset)
182+
183+
type_ignore = TypeIgnore(int lineno, string tag)
184+
}

0 commit comments

Comments
 (0)