Skip to content

add SEEK_* values to io and/or io.IOBase #48822

Description

@gumpy
mannequin
BPO 4572
Nosy @birkenfeld, @pitrou

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 2009-04-01.21:01:02.040>
created_at = <Date 2008-12-07.04:44:22.364>
labels = ['type-feature', 'library']
title = 'add SEEK_* values to io and/or io.IOBase'
updated_at = <Date 2009-04-01.21:01:01.983>
user = 'https://bugs.python.org/gumpy'

bugs.python.org fields:

activity = <Date 2009-04-01.21:01:01.983>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = <Date 2009-04-01.21:01:02.040>
closer = 'georg.brandl'
components = ['Library (Lib)']
creation = <Date 2008-12-07.04:44:22.364>
creator = 'gumpy'
dependencies = []
files = []
hgrepos = []
issue_num = 4572
keywords = []
message_count = 3.0
messages = ['77213', '78678', '85092']
nosy_count = 3.0
nosy_names = ['georg.brandl', 'pitrou', 'gumpy']
pr_nums = []
priority = 'normal'
resolution = 'accepted'
stage = None
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue4572'
versions = ['Python 3.1', 'Python 2.7']

Activity

  1. gumpy commented on Dec 7, 2008

    gumpymannequin
    MannequinAuthor

    Currently io.IOBase.seek(offset[, whence]) uses magic numbers for the
    second argument. Since this is essentially identical the C function
    fseek I think adding the same "constants" that C uses (SEEK_SET=0,
    SEEK_CUR=1, SEEK_END=2) may be worth considering.

    These values could be added to the global scope in the io module:
    f = io.open('foo', 'rb')
    f.seek(0, io.SEEK_END)

    If added to the io.IOBase class then I believe they'd be accessible
    without importing io:
    f = open('foo', 'rb')
    f.seek(0, f.SEEK_END)

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    type-featureA feature request or enhancement
    on Dec 7, 2008
  3. pitrou commented on Jan 1, 2009

    @pitrou
    Member

    Sounds like a nice improvement.

  4. birkenfeld commented on Apr 1, 2009

    @birkenfeld
    Member

    Added in r70992.

  5. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions