From owner-freebsd-python@freebsd.org Mon Jul 31 23:49:09 2017 Return-Path: Delivered-To: freebsd-python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD366DC0889 for ; Mon, 31 Jul 2017 23:49:09 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id B6EC06E4A3 for ; Mon, 31 Jul 2017 23:49:09 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: by mailman.ysv.freebsd.org (Postfix) id B30E5DC0887; Mon, 31 Jul 2017 23:49:09 +0000 (UTC) Delivered-To: python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B277CDC0886; Mon, 31 Jul 2017 23:49:09 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DCC56E4A2; Mon, 31 Jul 2017 23:49:09 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id v6VNai80068018 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 31 Jul 2017 16:36:44 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id v6VNah8m068017; Mon, 31 Jul 2017 16:36:43 -0700 (PDT) (envelope-from sgk) Date: Mon, 31 Jul 2017 16:36:43 -0700 From: Steve Kargl To: freebsd-ports@freebsd.org, python@FreeBSD.org Subject: Re: [PATCH] lang/python27 -- Fix namespace collision Message-ID: <20170731233643.GA59276@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <20170618182905.GA67867@troutmask.apl.washington.edu> <20170618183112.GA67920@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170618183112.GA67920@troutmask.apl.washington.edu> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 23:49:09 -0000 Any chance that the patch will be added to lang/python27? -- steve On Sun, Jun 18, 2017 at 11:31:12AM -0700, Steve Kargl wrote: > On Sun, Jun 18, 2017 at 11:29:05AM -0700, Steve Kargl wrote: > > Both IEEE-754 2008 and ISO/IEC TS 18661-4 define the half-cycle > > trignometric functions cospi, sinpi, and tanpi. When libm (aka > > math.h) grows support for sinpi(x), lang/python27 has a namespace > > collision. The attached patch fixes the problem. > > > > Well, that's inconvenient. Seems attachments are stripped. > > --- Modules/mathmodule.c.orig 2017-06-18 11:09:05.938222000 -0700 > +++ Modules/mathmodule.c 2017-06-18 11:09:56.248307000 -0700 > @@ -71,7 +71,7 @@ > static const double sqrtpi = 1.772453850905516027298167483341145182798; > > static double > -sinpi(double x) > +my_sinpi(double x) > { > double y, r; > int n; > @@ -270,7 +270,7 @@ > integer. */ > if (absx > 200.0) { > if (x < 0.0) { > - return 0.0/sinpi(x); > + return 0.0/my_sinpi(x); > } > else { > errno = ERANGE; > @@ -294,7 +294,7 @@ > } > z = z * lanczos_g / y; > if (x < 0.0) { > - r = -pi / sinpi(absx) / absx * exp(y) / lanczos_sum(absx); > + r = -pi / my_sinpi(absx) / absx * exp(y) / lanczos_sum(absx); > r -= z * r; > if (absx < 140.0) { > r /= pow(y, absx - 0.5); > @@ -366,7 +366,7 @@ > (x-0.5)*(log(x+lanczos_g-0.5)-1); > } > else { > - r = log(pi) - log(fabs(sinpi(absx))) - log(absx) - > + r = log(pi) - log(fabs(my_sinpi(absx))) - log(absx) - > (log(lanczos_sum(absx)) - lanczos_g + > (absx-0.5)*(log(absx+lanczos_g-0.5)-1)); > } > > -- > Steve > 20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4 > 20161221 https://www.youtube.com/watch?v=IbCHE-hONow > _______________________________________________ > freebsd-ports@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org" -- Steve 20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4 20161221 https://www.youtube.com/watch?v=IbCHE-hONow