Skip to content

Conversation

@savanto
Copy link
Contributor

@savanto savanto commented Dec 28, 2025

Follow-up to #15183:

1. append method accepts None for most args

Docstring for append method says:

All args except `message' can be None.

v3.0
v3.14

The body of the method performs truthiness checks on each argument
except message and sets them to an appropriate value or None anyway.


2. date_time arg to append can be a union of types

The append method passes date_time immediately
into the Time2Internaldate function, so it seems reasonable to have
append accept anything that Time2Internaldate would accept.

Docstring for append method says:
```
All args except `message' can be None.
```
[v3.0](https://github.com/python/cpython/blob/v3.0/Lib/imaplib.py#L318)
[v3.14](https://github.com/python/cpython/blob/v3.14.0/Lib/imaplib.py#L485)

The body of the method performs truthiness checks on each argument
except `message` and sets them to an appropriate value or None anyway.
The append method passes `date_time` (after None check) immediately
into the `Time2Internaldate` function, so it seems reasonable to have
append accept anything that `Time2Internaldate` would accept.
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant