MCPcopy Index your code
hub / github.com/RustPython/RustPython / _neg

Method _neg

crates/vm/src/vm/vm_ops.rs:527–531  ·  view source on GitHub ↗
(&self, a: &PyObject)

Source from the content-addressed store, hash-verified

525 }
526
527 pub fn _neg(&self, a: &PyObject) -> PyResult {
528 self.get_special_method(a, identifier!(self, __neg__))?
529 .ok_or_else(|| self.new_unsupported_unary_error(a, "unary -"))?
530 .invoke((), self)
531 }
532
533 pub fn _invert(&self, a: &PyObject) -> PyResult {
534 const STR: &str = "Bitwise inversion '~' on bool is deprecated and will be removed in Python 3.16. \

Callers 2

execute_instructionMethod · 0.80
negFunction · 0.80

Calls 4

ok_or_elseMethod · 0.80
get_special_methodMethod · 0.80
invokeMethod · 0.45

Tested by

no test coverage detected