(define-module (language python bool) #:use-module (oop goops) #:use-module (language python exceptions) #:use-module (oop pf-objects) #:export (bool)) (define-syntax-rule (aif it p x y) (let ((it p)) (if it x y))) (define-method (bool x) (cond ((null? x) #f) ((eq? x None) #f) (else x))) (define-method (bool (x )) (not (= x 0))) (define-method (bool (x

)) (aif it (ref x '__bool__) (it) (next-method)))