How to detect that a function argument is the default one

Jean-Michel Pichavant jeanmichel at sequans.com
Thu Dec 11 05:02:45 EST 2014


----- Original Message -----
> From: "ast" <nomail at invalid.com>

> >
> >> Note : what is the mass of a circle ?
> >
> 
> In fact it's a ball moving in a plan.
> I will change that name.

I would advise to remove the the mass parameter of your Sphere initialization. It could be inconsistent with the radius.
To compute the mass you would need the radius and the  volumetric mass density.

pseudo code:

class Sphere(object):
  def __init__(self, center, radius, density):

  @property
  def volume(self):
    return 4/3.*pi*self.radius^3

  @property
  def mass(self):
    return self.volume*self.density

You'll find no the net the density for most of the materials.

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


More information about the Python-list mailing list