Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
70c5f2ae
Commit
70c5f2ae
authored
Jun 01, 2019
by
Serhiy Storchaka
Committed by
GitHub
Jun 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use more PEP 570 syntax in the documentation. (GH-13720)
parent
2085bd08
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
19 deletions
+19
-19
Doc/faq/programming.rst
Doc/faq/programming.rst
+2
-2
Doc/howto/logging-cookbook.rst
Doc/howto/logging-cookbook.rst
+15
-15
Doc/library/functools.rst
Doc/library/functools.rst
+1
-1
Doc/reference/datamodel.rst
Doc/reference/datamodel.rst
+1
-1
No files found.
Doc/faq/programming.rst
View file @
70c5f2ae
...
...
@@ -554,8 +554,8 @@ desired effect in a number of ways.
5) Or bundle up values in a class instance::
class callByRef:
def __init__(self, **args):
for
(key, value)
in args.items():
def __init__(self,
/,
**args):
for
key, value
in args.items():
setattr(self, key, value)
def func4(args):
...
...
Doc/howto/logging-cookbook.rst
View file @
70c5f2ae
...
...
@@ -579,7 +579,7 @@ information. When you call one of the logging methods on an instance of
information in the delegated call. Here'
s
a
snippet
from
the
code
of
:
class
:`
LoggerAdapter
`::
def
debug
(
self
,
msg
,
*
args
,
**
kwargs
):
def
debug
(
self
,
msg
,
/,
*
args
,
**
kwargs
):
"""
Delegate a debug call to the underlying logger, after adding
contextual information from this adapter instance.
...
...
@@ -1079,7 +1079,7 @@ call ``str()`` on that object to get the actual format string. Consider the
following two classes::
class BraceMessage:
def __init__(self, fmt, *args, **kwargs):
def __init__(self, fmt,
/,
*args, **kwargs):
self.fmt = fmt
self.args = args
self.kwargs = kwargs
...
...
@@ -1088,7 +1088,7 @@ following two classes::
return self.fmt.format(*self.args, **self.kwargs)
class DollarMessage:
def __init__(self, fmt, **kwargs):
def __init__(self, fmt,
/,
**kwargs):
self.fmt = fmt
self.kwargs = kwargs
...
...
@@ -1143,7 +1143,7 @@ to the above, as in the following example::
import
logging
class
Message
(
object
)
:
class
Message
:
def
__init__
(
self
,
fmt
,
args
):
self
.
fmt
=
fmt
self
.
args
=
args
...
...
@@ -1155,7 +1155,7 @@ to the above, as in the following example::
def
__init__
(
self
,
logger
,
extra
=
None
):
super
(
StyleAdapter
,
self
).
__init__
(
logger
,
extra
or
{})
def
log
(
self
,
level
,
msg
,
*
args
,
**
kwargs
):
def
log
(
self
,
level
,
msg
,
/,
*
args
,
**
kwargs
):
if
self
.
isEnabledFor
(
level
):
msg
,
kwargs
=
self
.
process
(
msg
,
kwargs
)
self
.
logger
.
_log
(
level
,
Message
(
msg
,
args
),
(),
**
kwargs
)
...
...
@@ -1301,7 +1301,7 @@ You can also subclass :class:`QueueListener` to get messages from other kinds
of queues, for example a ZeroMQ '
subscribe
' socket. Here'
s
an
example
::
class
ZeroMQSocketListener
(
QueueListener
):
def
__init__
(
self
,
uri
,
*
handlers
,
**
kwargs
):
def
__init__
(
self
,
uri
,
/,
*
handlers
,
**
kwargs
):
self
.
ctx
=
kwargs
.
get
(
'ctx'
)
or
zmq
.
Context
()
socket
=
zmq
.
Socket
(
self
.
ctx
,
zmq
.
SUB
)
socket
.
setsockopt_string
(
zmq
.
SUBSCRIBE
,
''
)
#
subscribe
to
everything
...
...
@@ -1706,8 +1706,8 @@ which uses JSON to serialise the event in a machine-parseable manner::
import json
import logging
class StructuredMessage
(object)
:
def __init__(self, message, **kwargs):
class StructuredMessage:
def __init__(self, message,
/,
**kwargs):
self.message = message
self.kwargs = kwargs
...
...
@@ -1750,8 +1750,8 @@ as in the following complete example::
return o.encode('unicode_escape').decode('ascii')
return super(Encoder, self).default(o)
class StructuredMessage
(object)
:
def __init__(self, message, **kwargs):
class StructuredMessage:
def __init__(self, message,
/,
**kwargs):
self.message = message
self.kwargs = kwargs
...
...
@@ -1982,8 +1982,8 @@ object as a message format string, and that the logging package will call
:func:`str` on that object to get the actual format string. Consider the
following two classes::
class BraceMessage
(object)
:
def __init__(self, fmt, *args, **kwargs):
class BraceMessage:
def __init__(self, fmt,
/,
*args, **kwargs):
self.fmt = fmt
self.args = args
self.kwargs = kwargs
...
...
@@ -1991,8 +1991,8 @@ following two classes::
def __str__(self):
return self.fmt.format(*self.args, **self.kwargs)
class DollarMessage
(object)
:
def __init__(self, fmt, **kwargs):
class DollarMessage:
def __init__(self, fmt,
/,
**kwargs):
self.fmt = fmt
self.kwargs = kwargs
...
...
@@ -2457,7 +2457,7 @@ scope of the context manager::
import logging
import sys
class LoggingContext
(object)
:
class LoggingContext:
def __init__(self, logger, level=None, handler=None, close=True):
self.logger = logger
self.level = level
...
...
Doc/library/functools.rst
View file @
70c5f2ae
...
...
@@ -252,7 +252,7 @@ The :mod:`functools` module defines the following functions:
18
.. class:: partialmethod(func, *args, **keywords)
.. class:: partialmethod(func,
/,
*args, **keywords)
Return a new :class:`partialmethod` descriptor which behaves
like :class:`partial` except that it is designed to be used as a method
...
...
Doc/reference/datamodel.rst
View file @
70c5f2ae
...
...
@@ -1809,7 +1809,7 @@ class defining the method.
class, as in::
class Philosopher:
def __init_subclass__(cls, default_name, **kwargs):
def __init_subclass__(cls,
/,
default_name, **kwargs):
super().__init_subclass__(**kwargs)
cls.default_name = default_name
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment