Skip to content

Function's and FunctionHeader's reset_last_change() does not call the super()'s function #234

Description

@themaks

When reset_last_change() is called on a Function or FunctionHeader, it iterates over their arguments', stackvars' and header's own reset_last_change(), but it never actually apply the useful modification (self.last_change = None) to themselves.

Function.reset_last_change and FunctionHeader.reset_last_change should also call super().reset_last_change():

  • In Function:

    def reset_last_change(self):
    if self.header:
    self.header.reset_last_change()
    if self.stack_vars:
    for sv in self.stack_vars.values():
    sv.reset_last_change()

  • In FunctionHeader:

    def reset_last_change(self):
    if self.args:
    for arg in self.args.values():
    arg.reset_last_change()

Actually the comment in their respective super-class, Artifact tells us this was intended, but forgotten:

def reset_last_change(self):
"""
Resets the change time of the Artifact.
In subclasses, this should also reset all artifacts with nested artifacts
"""
self.last_change = None

Cheers

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions