Skip to content

Commit

Permalink
Updated comments about expunge and uid_expunge :
Browse files Browse the repository at this point in the history
More "formal" :
* Removed ``uid_expunge`` first appearance context.
* Deprecated notice for ``expunge`` with *messages*.
  • Loading branch information
axoroll7 authored and mjs committed Aug 19, 2023
1 parent c47e784 commit bb9cfbf
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions imapclient/imapclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -1467,17 +1467,20 @@ def move(self, messages, folder):
)

def expunge(self, messages=None):
"""When, no *messages* are specified, remove all messages
"""Use of the *messages* argument is discouraged.
Please see the ``uid_expunge`` method instead.
When, no *messages* are specified, remove all messages
from the currently selected folder that have the
``\\Deleted`` flag set.
The return value is the server response message
followed by a list of expunge responses. For example::
('Expunge completed.',
[(2, 'EXPUNGE'),
(1, 'EXPUNGE'),
(0, 'RECENT')])
[(2, 'EXPUNGE'),
(1, 'EXPUNGE'),
(0, 'RECENT')])
In this case, the responses indicate that the message with
sequence numbers 2 and 1 where deleted, leaving no recent
Expand Down Expand Up @@ -1507,10 +1510,10 @@ def expunge(self, messages=None):

@require_capability("UIDPLUS")
def uid_expunge(self, messages):
"""Same functionality as ``expunge``, but *messages* must be
specified, and the capability UIDPLUS is tested beforehand. It should
be more fail-proof than ``expunge`` with *messages*, which cannot be
updated to prevent breaking compability with existing codebase.
"""Expunge deleted messages with the specified message ids from the
folder.
This requires the UIDPLUS capability.
See :rfc:`4315#section-2.1` section 2.1 for more details.
"""
Expand Down

0 comments on commit bb9cfbf

Please sign in to comment.