Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mmap.mmap as a context manager #52294

Closed
briancurtin opened this issue Mar 3, 2010 · 2 comments
Closed

mmap.mmap as a context manager #52294

briancurtin opened this issue Mar 3, 2010 · 2 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@briancurtin
Copy link
Member

BPO 8046
Nosy @birkenfeld, @briancurtin
Files
  • mmap_context_mgr.diff: patch against trunk
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2010-08-01.14:50:07.134>
    created_at = <Date 2010-03-03.03:39:51.541>
    labels = ['type-feature', 'library']
    title = 'mmap.mmap as a context manager'
    updated_at = <Date 2010-08-01.14:50:07.133>
    user = 'https://github.com/briancurtin'

    bugs.python.org fields:

    activity = <Date 2010-08-01.14:50:07.133>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-08-01.14:50:07.134>
    closer = 'georg.brandl'
    components = ['Library (Lib)']
    creation = <Date 2010-03-03.03:39:51.541>
    creator = 'brian.curtin'
    dependencies = []
    files = ['16420']
    hgrepos = []
    issue_num = 8046
    keywords = ['patch', 'needs review']
    message_count = 2.0
    messages = ['100331', '112336']
    nosy_count = 2.0
    nosy_names = ['georg.brandl', 'brian.curtin']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = 'patch review'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue8046'
    versions = ['Python 3.2']

    @briancurtin
    Copy link
    Member Author

    Most file or file-like objects operate as context managers, except for mmap (and maybe a few others?). Attached is a patch with tests and documentation.

    The patch also introduces an additional attribute to mmap, "closed".

    @briancurtin briancurtin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Mar 3, 2010
    @birkenfeld
    Copy link
    Member

    Thanks, adapted to current trunk and applied in r83406.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants