Ticket #10271: trac_10271_bigoh_extension.patch

File trac_10271_bigoh_extension.patch, 730 bytes (added by tkluck, 11 years ago)
  • sage/rings/big_oh.py

    # HG changeset patch
    # User Timo Kluck <tkluck@infty.nl>
    # Date 1300289307 -3600
    # Node ID 6ce4798c6797796bf55cb4a03523ccab4b841499
    # Parent  361a4ad7d52c69b64ae2e658ffd0820af0d87e93
    Trac 10271: allow big_oh for any object with degree() and add_bigoh()
    
    diff -r 361a4ad7d52c -r 6ce4798c6797 sage/rings/big_oh.py
    a b  
    8484
    8585    elif isinstance(x, padic_generic_element.pAdicGenericElement):
    8686         return x.parent()(0, absprec = x.valuation())
     87
     88    elif(hasattr(x, "add_bigoh") and hasattr(x, "degree")):
     89        return x.add_bigoh(x.degree())
     90   
    8791    raise ArithmeticError, "O(x) not defined"
    8892