Skip to content

Support matrix multiplication operator (@) - #2287

Merged
gvanrossum merged 3 commits into
python:masterfrom
elazarg:matmul
Oct 20, 2016
Merged

gvanrossum merged 3 commits into
python:masterfrom
elazarg:matmul

Conversation

@elazarg

@elazarg elazarg commented Oct 19, 2016

Copy link
Copy Markdown
Contributor

Fix #705

Added old parser support too.

Comment thread test-data/unit/check-expressions.test Outdated
main:5: error: Unsupported left operand type for * ("B")

[case testMatMul]

Copy link
Copy Markdown
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.

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
Copy Markdown
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?

@elazarg elazarg Oct 19, 2016 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
Copy Markdown
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