Is there a way to customise math.sqrt(x) for some x?

rantingrick rantingrick at gmail.com
Sat Jul 23 23:09:31 CEST 2011


On Jul 16, 3:35 am, Steven D'Aprano <steve
+comp.lang.pyt... at pearwood.info> wrote:
> I have a custom object that customises the usual maths functions and
> operators, such as addition, multiplication, math.ceil etc.
>
> Is there a way to also customise math.sqrt? I don't think there is, but I
> may have missed something.

Hmm, this question should win ambiguous award of the year. Here, allow
me to answer by proxy.

----------------------------------------
 Ambiguos Caller Sketch
----------------------------------------
SCENE: (A car owner calls a custom body shop to request work on his
car)
SHOP: "Custom Car Works, how may we help you?"
OWNER: Hello sir. I would like to customize my car.
SHOP: Sure. What kind of car is it exactly?
OWNER: Well i would say it's a normal car.
SHOP: Okay. What size engine does it have?
OWNER: I would say it's a fairy large engine.
SHOP: Interesting. So what kind of work are you needing?
OWNER: Something custom because i want it to look very "customized".
SHOP: Well Sir we are after all a CUSTOM shop! *rolls-eyes*
OWNER: Great, because i need some custom work!
SHOP: Okay Sir, would you like us to PAINT your car?
OWNER: Sure, that would be great.
SHOP: Okay, so what color should we PAINT your car?
OWNER: A light color would be fine.
SHOP: I see. I think we can handle this job for you just fine however
I just have one more question.
OWNER: Yes...
SHOP: Tell me, does this sound like a phone hanging up? *click*
OWNER: Yes.
...
OWNER: Hello?
...
OWNER: Are you there?
----------------------------------------




More information about the Python-list mailing list