GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Type cache can expose previous values during finalization of an object · Issue #118492 · python/cpython

Type cache can expose previous values during finalization of an object #118492

New issue
Copy link
New issue
Copy link
Open
Open
Type cache can expose previous values during finalization of an object#118492
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@DinoV
DinoV
opened on May 1, 2024
Issue body actions

Bug report

Bug description:

This should always print True, that is an attribute accessed from a class should match the value that's in the type's mappingproxy:

class X:
    def __del__(inner_self):
        v = C.a
        print(v == C.__dict__['a'])

class C:
    a = X()

# prime the cache
C.a
C.a

# destructor shouldn't be able to see inconsisent state
C.a = X()
C.a = X()

But this prints False because the destructor can be run when the assignment into the type dict occurs, but before the type version is invalidated.

CPython versions tested on:

3.8, CPython main branch

Operating systems tested on:

Linux

Activity

  1. DinoV
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on May 1, 2024
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

    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.