Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/reusable-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ name: Reusable Docs
on:
workflow_call:
workflow_dispatch:
# Pushes to CPython branches seed the pip caches under the exact keys every
# docs PR restores from. Without a branch-scoped copy, each PR saves a
# duplicate into its own refs/pull/N/merge scope that nothing else can read.
push:
branches:
- main
- '3.*'
paths:
- 'Doc/pylock.toml'
- 'Doc/requirements.txt'
- '.github/workflows/reusable-docs.yml'

permissions:
contents: read
Expand Down
9 changes: 8 additions & 1 deletion Doc/library/email.utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ of the new API.
Add *strict* optional parameter and reject malformed inputs by default.


.. function:: formataddr(pair, charset='utf-8')
.. function:: formataddr(pair, charset='utf-8', *, strict=True)

The inverse of :meth:`parseaddr`, this takes a 2-tuple of the form ``(realname,
email_address)`` and returns the string value suitable for a :mailheader:`To` or
Expand All @@ -82,9 +82,16 @@ of the new API.
characters. Can be an instance of :class:`str` or a
:class:`~email.charset.Charset`. Defaults to ``utf-8``.

If *strict* is true (the default), raise :exc:`ValueError` for inputs that
contain CR or LF, which are not allowed in an email address. Set *strict*
to ``False`` to allow non-strict inputs.

.. versionchanged:: 3.3
Added the *charset* option.

.. versionchanged:: next
Added the *strict* parameter.


.. function:: getaddresses(fieldvalues, *, strict=True)

Expand Down
12 changes: 12 additions & 0 deletions Include/internal/pycore_dict.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ typedef struct {
} PyDictUnicodeEntry;

extern PyDictKeysObject *_PyDict_NewKeysForClass(PyHeapTypeObject *);
extern void _PyDict_RemoveKeysForClass(PyHeapTypeObject *);
extern PyObject *_PyDict_FromKeys(PyObject *, PyObject *, PyObject *);

/* Implementations of the `|` and `|=` operators for dict, used by the
Expand Down Expand Up @@ -239,6 +240,17 @@ struct _dictkeysobject {
see the DK_ENTRIES() / DK_UNICODE_ENTRIES() functions below */
};

struct _instancekeysobject {
PyTypeObject* dsk_owning_type;
struct _dictkeysobject dsk_keys;
};

static inline struct _instancekeysobject *_PyDictKeys_AsSharedKeys(struct _dictkeysobject *keys)
{
assert(keys->dk_kind == DICT_KEYS_SPLIT);
return _Py_CONTAINER_OF(keys, struct _instancekeysobject, dsk_keys);
}

/* This must be no more than 250, for the prefix size to fit in one byte. */
#define SHARED_KEYS_MAX_SIZE 30
#define NEXT_LOG2_SHARED_KEYS_MAX_SIZE 6
Expand Down
4 changes: 2 additions & 2 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Include/internal/pycore_typeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ extern int _PyType_AddMethod(PyTypeObject *, PyMethodDef *);
extern void _PyType_SetFlagsRecursive(PyTypeObject *self, unsigned long mask,
unsigned long flags);

// Raise PyType_Modified with the type lock already held.
extern void _PyType_Modified_Unlocked(PyTypeObject *type);

PyAPI_FUNC(void) _PyType_SetVersion(PyTypeObject *tp, unsigned int version);
PyTypeObject *_PyType_LookupByVersion(unsigned int version);

Expand Down
Loading
Loading