[issue7769] SimpleXMLRPCServer.SimpleXMLRPCServer.register_function as decorator

2011-03-09 Thread Johannes Schönberger
Johannes Schönberger added the comment: sorry, I totally forgot about this... -- ___ Python tracker <http://bugs.python.org/issue7769> ___ ___ Python-bugs-list m

[issue7770] sin/cos function in decimal-docs

2010-01-24 Thread Johannes Schönberger
Johannes Schönberger added the comment: sorry, forgot the str: def rsin(x): """Return the sine of x as measured in radians. >>> print sin(Decimal('0.5')) 0.4794255386042030002732879352 >>> print sin(0.5) 0.479425538604 &

[issue7770] sin/cos function in decimal-docs

2010-01-24 Thread Johannes Schönberger
Johannes Schönberger added the comment: This adds two further lines, so you can pass int's, float's or Decimal types to the function. def sin(x): """Return the sine of x as measured in radians. >>> print sin(Decimal('0.5')) 0.479425

[issue7769] SimpleXMLRPCServer.SimpleXMLRPCServer.register_function as decorator

2010-01-24 Thread Johannes Schönberger
Johannes Schönberger added the comment: OK, will work on it and reply as soon as I have results! -- ___ Python tracker <http://bugs.python.org/issue7769> ___ ___

[issue7769] SimpleXMLRPCServer.SimpleXMLRPCServer.register_function as decorator

2010-01-24 Thread Johannes Schönberger
Johannes Schönberger added the comment: OK, thank you for the links! Do you still want me to do anything (like test cases etc.)? -- ___ Python tracker <http://bugs.python.org/issue7

[issue7769] SimpleXMLRPCServer.SimpleXMLRPCServer.register_function as decorator

2010-01-24 Thread Johannes Schönberger
Johannes Schönberger added the comment: I'm not very used to working with bug/issue trackers, is there any tutorial here, where this is explained? I did the stuff you asked me to do: diff: http://paste.pocoo.org/compare/169357/169359/ test: http://paste.pocoo.org/show/1

[issue7770] sin/cos function in decimal-docs

2010-01-24 Thread Johannes Schönberger
Johannes Schönberger added the comment: stupid, it is much better to just use the modulo operator. The same works with cos... def sin(x): """Return the sine of x as measured in radians. >>> print sin(Decimal('0.5')) 0.4794255386042030

[issue7770] sin/cos function in decimal-docs

2010-01-24 Thread Johannes Schönberger
Johannes Schönberger added the comment: This is the version I would suggest and which is quite accurate unless the numbers get extremely large. def sin(x): """Return the sine of x as measured in radians. >>> print sin(Decimal('0.5')) 0.47942553

[issue7770] sin/cos function in decimal-docs

2010-01-24 Thread Johannes Schönberger
New submission from Johannes Schönberger : Unfortunately the sin/cos function in the decimal docs seems to return false results. In [33]: sin(decimal.Decimal('75')) Out[33]: Decimal('0.377879483645203210442266845614') In [34]: sin(decimal.Decimal(&#x

[issue7769] SimpleXMLRPCServer.SimpleXMLRPCServer.register_function as decorator

2010-01-24 Thread Johannes Schönberger
New submission from Johannes Schönberger : I would suggest to make SimpleXMLRPCServer.SimpleXMLRPCServer.register_function a decorator function. See the attached file for the solution I wrote (l.209-240), which also works with the current syntax: @server.register_function