Skip to content

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented May 18, 2022

Borrow an operand such as x.y (attribute of a native class) in various contexts
when it's safe to do so. This reduces the number of incref/decref operations we
need to perform. This continues work started in #12805.

These cases now support borrowing (for some subexpressions, in some contexts):

  • x.y is None
  • Cast source value
  • len(x.y) (if the operand is a list)
  • isinstance(x.y, C)
  • x.y[a.b]
  • x.y.z = 1

@JukkaL JukkaL merged commit f71dba7 into master May 19, 2022
@JukkaL JukkaL deleted the refcount-misc-opts branch May 19, 2022 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants