Ticket #13390: trac_13390-fix_NonNegativeIntegers.patch

File trac_13390-fix_NonNegativeIntegers.patch, 764 bytes (added by sstarosta, 9 years ago)

tested on sage 5.3.beta1

  • sage/sets/non_negative_integers.py

    # HG changeset patch
    # User Stepan Starosta <stepan.starosta@gmail.com>
    # Date 1346180669 -7200
    # Node ID 5c04a6ee3c7f42fc5cf4b8b3d1e69a3e7ef40d43
    # Parent  c5d37f3dfa9ffe716ef4b5032f3f830558f99825
    #13390: fix contains method for NonNegativeIntegers()
    
    diff --git a/sage/sets/non_negative_integers.py b/sage/sets/non_negative_integers.py
    a b  
    102102            False
    103103            sage: x in NN
    104104            False
     105            sage: None in NN
     106            False
    105107        """
    106108        try:
    107             return Integer(elt) >= Integer(0)
     109            i = Integer(elt)
     110            return  i >= Integer(0) and i == elt
    108111        except TypeError:
    109112            return False
    110113