We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a93914 commit be6ea2aCopy full SHA for be6ea2a
Lib/test/test_bool.py
@@ -7,8 +7,6 @@
7
8
class BoolTest(unittest.TestCase):
9
10
- # TODO: RUSTPYTHON
11
- @unittest.expectedFailure
12
def test_subclass(self):
13
try:
14
class C(bool):
vm/src/builtins/int.rs
@@ -212,6 +212,12 @@ impl Constructor for PyInt {
212
type Args = IntOptions;
213
214
fn py_new(cls: PyTypeRef, options: Self::Args, vm: &VirtualMachine) -> PyResult {
215
+ if cls.is(vm.ctx.types.bool_type) {
216
+ return Err(
217
+ vm.new_type_error("int.__new__(bool) is not safe, use bool.__new__()".to_owned())
218
+ );
219
+ }
220
+
221
let value = if let OptionalArg::Present(val) = options.val_options {
222
if let OptionalArg::Present(base) = options.base {
223
let base = base
0 commit comments