Skip to content

Support matrix multiplication operator (@) #2287

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

Merged
merged 3 commits into from
Oct 20, 2016
Merged

Conversation

elazarg
Copy link
Contributor

@elazarg elazarg commented Oct 19, 2016

Fix #705

Added old parser support too.

@@ -182,6 +182,22 @@ main:3: error: Unsupported operand types for * ("A" and "C")
main:4: error: Incompatible types in assignment (expression has type "C", variable has type "A")
main:5: error: Unsupported left operand type for * ("B")

[case testMatMul]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please go easy on the blank lines in unit tests. The files are long enough.

@@ -182,6 +182,22 @@ main:3: error: Unsupported operand types for * ("A" and "C")
main:4: error: Incompatible types in assignment (expression has type "C", variable has type "A")
main:5: error: Unsupported left operand type for * ("B")

[case testMatMul]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need separate tests for --fast-parser?

Copy link
Contributor Author

@elazarg elazarg Oct 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. Do we? It already supports the operator. Looks like this work is delegated to typed_ast.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a test to verify that the fast parser recognizes the operator. As far as I understand there's nothing more to test there, not more than there is for any other operator.

@gvanrossum gvanrossum merged commit 48fa2ef into python:master Oct 20, 2016
@gvanrossum
Copy link
Member

Thanks!

@elazarg elazarg deleted the matmul branch October 27, 2016 15:06
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.

2 participants