__gt__


Definition
Whether the value is greater than other value.

Syntax
__gt__

Parameters
N/A

Examples
 Equality test run through the pyramid web framework.
 
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response

def test(request):
    x=pow(3,10)
    y=13
    if x.__gt__(y):
        return Response('x is greater than y.')
    else:
        return Response('x is not greater than y.')

def main():
    config = Configurator()
    config.add_route('index', '/')                        
    config.add_view(test, route_name='index')
    app = config.make_wsgi_app()
    return app

if __name__ == '__main__':
    app = main()
    server = make_server('0.0.0.0', 1000, app)
    print ('Starting up server on http://localhost:1000')
    server.serve_forever()






Fraction.__gt__()
The fraction are following:
 >>> Fraction(2.111300).limit_denominator(1).__gt__(Fraction(2, 1))
False

The return is tested whether the one value is greater than other.
 >>> Fraction(2,3).numerator.__gt__(2)
False


The equal to:
 >>> Fraction(0,1).real.__gt__(Fraction(0, 1))
False


The value is:
 >>> Fraction(2,3).numerator.__gt__(2)
False


str.startwith().__gt__()
The return is equal to:
 >>> "Python Lake".startswith("P")
True
>>> "Python Lake".startswith("y")
False
>>> x="Python Lake"
>>> x.startswith("Lake")
False
>>> x.__gt__(y)
False
>>>

str.rstrip().__gt__(str)
The returns are:
 >>> "Python Lake ".rstrip()
'Python Lake'
>>> "Python Lake                            ".rstrip().__gt__("Python Lake ".rstrip())
False
>>> "Python Lake                            ".rstrip().__eq__("Python Lake ".rstrip())
True
>>> "Python Lake                             ".rstrip().__eq__("Python Lake")
True
>>> "Python Lake                             ".rstrip().__eq__(str("Python Lake"))
True
>>> type("Python Lake ".rstrip())
<class 'str'>
>>>


if min(map(lambda(decimal,decimal)).__gt__()
The method returns with the minimum value in the sets equation set1/set2*set2 is greater than 2. 
from decimal import*
set1={Decimal(-1355).adjusted(),Decimal(-233.321).copy_negate(), Decimal(-23.99).exp()}
set2={ Decimal(2.0).fma(3,7),Decimal(1.1).log10()}
if min(map(lambda a,b: a/b*b, set1, set2)).__gt__(2):
        print("Return is greater than 2.")
else:
        print("Not within parameters")

>>> 
Return is greater than 2.
>>>       

Comments