The Wayback Machine - https://web.archive.org/web/20201202170013/https://github.com/ProjectQ-Framework/ProjectQ/issues/19
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

CommandModifier forwards unmodified command_list instead of modified command_list #19

Closed
Strilanc opened this issue Mar 13, 2017 · 1 comment

Comments

@Strilanc
Copy link
Contributor

@Strilanc Strilanc commented Mar 13, 2017

def receive(self, command_list):
	...

	new_command_list = [self._cmd_mod_fun(cmd) for cmd in command_list]
            ^^^^^^^^^^^ unused

	self.send(command_list)
@thomashaener
Copy link
Contributor

@thomashaener thomashaener commented Mar 14, 2017

Thanks, good catch! It worked fine because the command modifiers modify cmd in-place, but if someone were to write a command modifier that returns a new command object, the list would indeed remain unmodified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.