Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82356

Re: How to detect that a function argument is the default one

Date 2014-12-11 11:02 +0100
From Jean-Michel Pichavant <jeanmichel@sequans.com>
Subject Re: How to detect that a function argument is the default one
Newsgroups comp.lang.python
Message-ID <mailman.16855.1418292827.18130.python-list@python.org> (permalink)

Show all headers | View raw


----- Original Message -----
> From: "ast" <nomail@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.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: How to detect that a function argument is the default one Jean-Michel Pichavant <jeanmichel@sequans.com> - 2014-12-11 11:02 +0100

csiph-web