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


Groups > comp.lang.python > #82356 > unrolled thread

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

Started byJean-Michel Pichavant <jeanmichel@sequans.com>
First post2014-12-11 11:02 +0100
Last post2014-12-11 11:02 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

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

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

FromJean-Michel Pichavant <jeanmichel@sequans.com>
Date2014-12-11 11:02 +0100
SubjectRe: How to detect that a function argument is the default one
Message-ID<mailman.16855.1418292827.18130.python-list@python.org>
----- 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.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web