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

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <prvs=415368415=jeanmichel@sequans.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status UNSURE 0.263
X-Spam-Level **
X-Spam-Evidence '*H*': 0.50; '*S*': 0.03; 'parameter': 0.09; 'subject:How': 0.10; 'def': 0.12; '@property': 0.16; 'compute': 0.16; 'plan.': 0.16; 'subject:default': 0.16; 'code:': 0.26; 'header:In-Reply-To:1': 0.27; 'ball': 0.31; 'subject:that': 0.31; 'class': 0.32; '-----': 0.33; 'skip:_ 10': 0.34; 'subject:the': 0.34; 'could': 0.34; 'mass': 0.36; 'subject:one': 0.36; 'thank': 0.38; 'to:addr:python-list': 0.38; 'fact': 0.38; 'moving': 0.39; 'to:addr:python.org': 0.39; 'remove': 0.60; 'most': 0.60; 'you.': 0.62; "you'll": 0.62; 'information': 0.63; 'received:194': 0.64; 'notice:': 0.67; 'circle': 0.68; 'person,': 0.68; 'privileged.': 0.69; 'disclose': 0.74; 'density': 0.84; 'medium.': 0.91; 'skip:4 20': 0.91
X-IronPort-AV E=Sophos;i="5.07,556,1413237600"; d="scan'208";a="3718111"
Date Thu, 11 Dec 2014 11:02:45 +0100 (CET)
From Jean-Michel Pichavant <jeanmichel@sequans.com>
To python-list@python.org
In-Reply-To <5488b874$0$2890$426a34cc@news.free.fr>
Subject Re: How to detect that a function argument is the default one
MIME-Version 1.0
X-Mailer Zimbra 7.2.7_GA_2942 (ZimbraWebClient - GC37 (Linux)/7.2.7_GA_2942)
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding base64
X-Mailman-Approved-At Thu, 11 Dec 2014 11:13:45 +0100
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.16855.1418292827.18130.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1418292827 news.xs4all.nl 2882 [2001:888:2000:d::a6]:33141
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:82356

Show key headers only | 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