Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

Complete implementation of operations on standard types #46

Open
freakboy3742 opened this issue Apr 13, 2016 · 151 comments · Fixed by #173, #180 or #192
Open

Complete implementation of operations on standard types #46

freakboy3742 opened this issue Apr 13, 2016 · 151 comments · Fixed by #173, #180 or #192

Comments

@freakboy3742
Copy link
Member

freakboy3742 commented Apr 13, 2016

Javascript has a specific set of allowed operator and operations. Python has a set of operators and operations as well. However, the two don't match exactly. For example, Javascript behavior for adding/multiplying with Strings leads to behaviour that is quite distinct to the behavior provided by Python.

In order to replicate Python behavior in Javascript, Python's logic for all the basic operations needs to be implemented in the Batavia support library.

The test suite contains around 10000 tests in the that are currently marked as "expected failures". These reflect an attempt to do "every operation between every base data type". The task: pick a data type, and write the implementation of one of the math operation or comparison operators.

The tests will pass (and become unexpected successes) when the output of Python code doing that operation is the same when run through CPython and Batavia - and I mean byte-identical, down to the text and punctuation of the error message if appropriate.

If you want to see an example of what is involved, check out the implementation of add for integers. If you have an int, Python will allows you to add an int or a float to it; all other types raise a TypeError. The list of operations on int that still need to be implemented can be found here; if you add a new operation, delete the line that corresponds to that test, and the test will report as a pass, rather than an expected fail.

@betojulio
Copy link
Contributor

I will work on test_multiply_float for String

@winza83
Copy link
Contributor

winza83 commented May 8, 2016

I'm still working on test_add_bool for string

@betojulio
Copy link
Contributor

working on test_add_list

@betojulio
Copy link
Contributor

working on test_add_none for string

@betojulio
Copy link
Contributor

working on test_multiply_none for string

@betojulio
Copy link
Contributor

betojulio commented May 11, 2016

working on test_unary_positive and test_unary_negative for string

@vyyyy
Copy link
Contributor

vyyyy commented May 16, 2016

working on test_subtract_str for String

@FlaviaBastos
Copy link
Contributor

Working on test_floor_divide_str for string

@FlaviaBastos
Copy link
Contributor

Ops. I guess test_floor_divide_str got resolved by @wlmiller on issue #67
I will pick something else to work on.

@wlmiller
Copy link
Contributor

I'm sorry about that - I should have more carefully checked what was already being worked on.

For what it's worth, tackling these operations one at a time for each pair probably isn't the best way to go about it. For example, if you resolve test_floor_divide_str for string, you're very likely to also resolve floor_divide tests for many other combinations of types (in particular combinations which can't be floor_divided, e.g. string // tuple, list // dict, etc.).

In #67 I set out to implement the abs builtin and ended up resolving a ton of other tests along the way, including dozens of the tests in datatypes.

A more natural division is by operation. For example, resolving all of the floor_divide tests where both types have been implemented is a very reasonable chunk to work on. You could divide it further - e.g. floor_divide where both sides are numbers or floor_divide for combinations that will result in TypeErrors. Anything smaller than that is probably a pretty unnatural way to split things up.

@FlaviaBastos
Copy link
Contributor

No worries!
I saw your implementation and there's no way I could have accomplished that. 😅 Good job!

@tfors
Copy link
Contributor

tfors commented Jun 2, 2016

working on test_setattr for string

@mauritt
Copy link
Contributor

mauritt commented Jun 2, 2016

I'm working on test_add_bool in in place string operations.

@mauritt
Copy link
Contributor

mauritt commented Jun 2, 2016

I'm working on test_add_tuple in in-place string operations.

@mauritt
Copy link
Contributor

mauritt commented Jun 2, 2016

Working on test_add_dict in in-place string operations.

@mauritt
Copy link
Contributor

mauritt commented Jun 2, 2016

Working on test_add_float in in-place string operations.

@netoxico
Copy link
Contributor

netoxico commented Jun 2, 2016

working on test_true_divide_bool

@mauritt
Copy link
Contributor

mauritt commented Jun 2, 2016

working on in-place additions to strings

@mbrownGraham
Copy link
Contributor

working on test_add_int

@ghost
Copy link

ghost commented Jun 2, 2016

working on test_pow_str

@bellisk
Copy link
Contributor

bellisk commented Jun 3, 2016

working on test_multiply_bool

@tfors
Copy link
Contributor

tfors commented Jun 3, 2016

working on Str inplace xor

@mauritt
Copy link
Contributor

mauritt commented Jun 3, 2016

Working on str in-place addition to str (test_add_str in InplaceStrOperationTests)

@mauritt
Copy link
Contributor

mauritt commented Jun 3, 2016

Working on 'test_add_set' in InplaceStrOperationTests

@rkenmi rkenmi mentioned this issue Aug 20, 2017
4 tasks
@vrootic
Copy link
Contributor

vrootic commented Aug 21, 2017

Fix test_unary_negative and test_unary_invert in test_set

@lielfr
Copy link
Contributor

lielfr commented Sep 1, 2017

working on all the tests.datatypes.test_slice.BinarySliceOperationTests.test_add_ cases

@mtn
Copy link
Contributor

mtn commented Sep 6, 2017

Working on tests.builtins.test_pow.PowTests 🖌

@lielfr
Copy link
Contributor

lielfr commented Sep 9, 2017

working on all tests.datatypes.test_slice.BinarySliceOperationTests.test_and_

@brandonsoto
Copy link
Contributor

Working on tests.datatypes.test_int.BinaryIntOperationTests.test_multiply_

@brandonsoto
Copy link
Contributor

brandonsoto commented Sep 25, 2017

Working on tests.datatypes.test_bytes.UnaryBytesOperationTests_, tests.datatypes.test_bytes.BinaryBytesOperationTests.test_and_, and tests.datatypes.test_bytes.InplaceBytesOperationTests.test_and_

@vrootic
Copy link
Contributor

vrootic commented Sep 27, 2017

Fixed tests.datatypes.test_bool.InplaceBoolOperationTests.test_true_divide_complex and tests.datatypes.test_bool.BinaryBoolOperationTests.test_true_divide_complex

@sebassdc
Copy link

sebassdc commented Oct 7, 2017

working on test.datatypes.test_str.StrTest.test_capitalize_no_args

@vishnu-m
Copy link

vishnu-m commented Dec 27, 2017

Can I take up test_truthiness

@ghost
Copy link

ghost commented Feb 19, 2018

I would like to work on test int - test_power_float.

@shubhamivane
Copy link

I want to contribute can somebody help. Where should I start.

@gobisa
Copy link
Contributor

gobisa commented Apr 1, 2018

Working on tests.datatypes.test_range.BinaryRangeOperationTests.test_add_* and tests.datatypes.test_range.BinaryRangeOperationTests.test_and_*

@NoahEhmann
Copy link
Contributor

I am working on:
bytearray: test_add_bytearray
bytearray: test_add_bytes
bytes: test_add_bytearray
bytes: test_add_bytes

@nateftw
Copy link

nateftw commented May 14, 2018

I am working on BinaryBytearrayOperationTests.test_add_int

@jonwesneski
Copy link

I am working on:
bytearray: test_power_* and test_and_*

@seeni-dev
Copy link
Contributor

I am working on locals() function

@alexjdw
Copy link
Contributor

alexjdw commented May 29, 2019

Working on test_conversion_types... done
Working on test_with_kwargs (test_str)

@nandithavalsaraj
Copy link

I am a new contributor and would like to work on test__mod__float.

@HimanshuBhawra
Copy link

Hi, I would like to work on this project, Is it still open? Where can I contribute?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet