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

C subtypes do not inherit tp_as_buffer #37919

Closed
glchapman mannequin opened this issue Feb 6, 2003 · 3 comments
Closed

C subtypes do not inherit tp_as_buffer #37919

glchapman mannequin opened this issue Feb 6, 2003 · 3 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@glchapman
Copy link
Mannequin

glchapman mannequin commented Feb 6, 2003

BPO 681367
Nosy @gvanrossum
Files
  • typeobject.c.diff
  • 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 = 'https://github.com/gvanrossum'
    closed_at = <Date 2003-02-11.20:48:39.000>
    created_at = <Date 2003-02-06.00:23:39.000>
    labels = ['interpreter-core']
    title = 'C subtypes do not inherit tp_as_buffer'
    updated_at = <Date 2003-02-11.20:48:39.000>
    user = 'https://bugs.python.org/glchapman'

    bugs.python.org fields:

    activity = <Date 2003-02-11.20:48:39.000>
    actor = 'gvanrossum'
    assignee = 'gvanrossum'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2003-02-06.00:23:39.000>
    creator = 'glchapman'
    dependencies = []
    files = ['782']
    hgrepos = []
    issue_num = 681367
    keywords = []
    message_count = 3.0
    messages = ['14471', '14472', '14473']
    nosy_count = 2.0
    nosy_names = ['gvanrossum', 'glchapman']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue681367'
    versions = ['Python 2.3']

    @glchapman
    Copy link
    Mannequin Author

    glchapman mannequin commented Feb 6, 2003

    Subtypes of str (for example) implemented in C do not
    inherit str's tp_as_buffer funcs unless the subtypes provide
    a pointer to a tp_as_buffer structure in their type struct.
    This is different from how the other method suites
    (tp_as_sequence, etc.) are handled; near the end of
    PyType_Ready the other method suites are copied from
    the base into the subtype if the subtype's slot is NULL.

    It looks like the tp_as_buffer omission is simply an
    oversight, since the flag manipulations in inherit_special
    appear to be preparing the way for copying the base
    pointer into the subtype. So I've attached a small patch
    (against the 2.3a1 version of typeobject.c) to fix this.

    @glchapman glchapman mannequin closed this as completed Feb 6, 2003
    @glchapman glchapman mannequin assigned gvanrossum Feb 6, 2003
    @glchapman glchapman mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Feb 6, 2003
    @glchapman glchapman mannequin closed this as completed Feb 6, 2003
    @glchapman glchapman mannequin assigned gvanrossum Feb 6, 2003
    @glchapman glchapman mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Feb 6, 2003
    @glchapman
    Copy link
    Mannequin Author

    glchapman mannequin commented Feb 6, 2003

    Logged In: YES
    user_id=86307

    aargh -- the patch didn't get attached; trying again.

    @gvanrossum
    Copy link
    Member

    Logged In: YES
    user_id=6380

    Accepted and checked in. I'm not 100% sure, but I can't see
    anything wrong with it, so here it goes.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant