Python 3: yum is dead, long live dnf!

2015-05-17 Thread Steven D'Aprano
As part of Red Hat's move to Python 3, yum is officially deprecated and replaced by dnf: http://dnf.baseurl.org/2015/05/11/yum-is-dead-long-live-dnf/ Quote: Yum would not survive the “Python 3 as default” Fedora initiative meanwhile DNF is able to run on Python 2 and Python 3.

Re: Building CPython

2015-05-17 Thread Marko Rauhamaa
Iterating. A line still missing: > > ### Simple OO Framework > > class _O: pass > > def make_object(*procedures, base=None, bases=None): > o = _O() > methods = {} > o.__methods__ = methods > o.__derived__ = N

Re: textwrap.wrap() breaks non-breaking spaces

2015-05-17 Thread Ned Batchelder
On Sunday, May 17, 2015 at 3:40:07 PM UTC-4, Johannes Bauer wrote: > Hey there, > > so that textwrap.wrap() breks non-breaking spaces, is this a bug or > intended behavior? For example: > > Python 3.4.0 (default, Apr 11 2014, 13:05:11) > [GCC 4.8.2] on linux > > >>> import textwrap > >>> for lin

Re: textwrap.wrap() breaks non-breaking spaces

2015-05-17 Thread Tim Chase
On 2015-05-17 21:39, Johannes Bauer wrote: > Hey there, > > so that textwrap.wrap() breks non-breaking spaces, is this a bug or > intended behavior? For example: > > Python 3.4.0 (default, Apr 11 2014, 13:05:11) > [GCC 4.8.2] on linux > > >>> import textwrap > >>> for line in textwrap.wrap("foo

textwrap.wrap() breaks non-breaking spaces

2015-05-17 Thread Johannes Bauer
Hey there, so that textwrap.wrap() breks non-breaking spaces, is this a bug or intended behavior? For example: Python 3.4.0 (default, Apr 11 2014, 13:05:11) [GCC 4.8.2] on linux >>> import textwrap >>> for line in textwrap.wrap("foo dont\xa0break " * 20): print(line) ... foo dont break foo dont

Re: Rule of order for dot operators?

2015-05-17 Thread Rustom Mody
On Sunday, May 17, 2015 at 11:01:01 PM UTC+5:30, Ned Batchelder wrote: > On Sunday, May 17, 2015 at 1:19:59 PM UTC-4, Thomas 'PointedEars' Lahn wrote: > > C.D. Reimer wrote: > > > Chris Reimer > > > > Please use this or something to that effect in your "From" header field > > value. > > Please s

Re: Rule of order for dot operators?

2015-05-17 Thread C.D. Reimer
On 5/17/2015 10:17 AM, Thomas 'PointedEars' Lahn wrote: C.D. Reimer wrote: Consider using a regular expression or the urllib object instead. See RFC 3986, Appendix B, and , respectively. That wouldn't work for me. I'm in the process of convertin

Re: Rule of order for dot operators?

2015-05-17 Thread Ned Batchelder
On Sunday, May 17, 2015 at 1:19:59 PM UTC-4, Thomas 'PointedEars' Lahn wrote: > C.D. Reimer wrote: > > Chris Reimer > > Please use this or something to that effect in your "From" header field > value. Please stop making strange requests of others. "C.D. Reimer" is a perfectly reasonable name to

Re: Rule of order for dot operators?

2015-05-17 Thread Thomas 'PointedEars' Lahn
Tim Chase wrote: > On 2015-05-16 12:20, C.D. Reimer wrote: >> Does python perform the dot operators from left to right or >> according to a rule of order (i.e., multiplication/division before >> add/subtract)? > > Yes, Python evaluates dot-operators from left to right. “.” is _not_ an operator i

Re: Rule of order for dot operators?

2015-05-17 Thread Thomas 'PointedEars' Lahn
C.D. Reimer wrote: > On 5/16/2015 12:40 PM, Thomas 'PointedEars' Lahn wrote: >> However, for greater efficiency, in general you should call .replace() >> in such a way that the length of the string it operates on is >> minimized. For example, if feasible, always slice *before* .replace(). > > Sli

Re: My attempts in playing with tail-recursion in python

2015-05-17 Thread Fred Spiessens
Hi Thomas, I like what you've been doing. I think it would also be great if the "leave the loop" detector would be the actual stop condition in the recursion, applied to the arguments of the call. That would of course force you to split the recursive function in two functions: one to detect the s

Re: I do not have access to the right _hierarchy.py source file

2015-05-17 Thread pegah Aliz
On Sunday, May 17, 2015 at 6:18:51 PM UTC+2, pegah Aliz wrote: > Hello Everybody, > > This question seems simple, but I can't find the solution: > > I use scipy.cluster.hierarchy to do a hierarchical clustering on a set of > points using "cosine" similarity metric. As an example, I have: > > >

Re: I do not have access to the right _hierarchy.py source file

2015-05-17 Thread pegah Aliz
On Sunday, May 17, 2015 at 6:18:51 PM UTC+2, pegah Aliz wrote: > Hello Everybody, > > This question seems simple, but I can't find the solution: > > I use scipy.cluster.hierarchy to do a hierarchical clustering on a set of > points using "cosine" similarity metric. As an example, I have: > > >

Re: I do not have access to the right _hierarchy.py source file

2015-05-17 Thread Peter Otten
pegah Aliz wrote: > To solve this problem, I checked linkage() function and inside it I needed > to check _hierarchy.linkage() method. I use pycharm text editor and when I > asked for "linkage" source code, it opened up a python file namely > "_hierarchy.py" inside the directory like the following

Re: I do not have access to the right _hierarchy.py source file

2015-05-17 Thread Gary Herron
On 05/17/2015 09:18 AM, pegah Aliz wrote: ... To solve this problem, I checked linkage() function and inside it I needed to check _hierarchy.linkage() method. I use pycharm text editor and when I asked for "linkage" source code, it opened up a python file namely "_hierarchy.py" inside the dire

Re: I do not have access to the right _hierarchy.py source file

2015-05-17 Thread Zachary Ware
On May 17, 2015 11:20 AM, "pegah Aliz" wrote: > > Hello Everybody, > > This question seems simple, but I can't find the solution: > To solve this problem, I checked linkage() function and inside it I needed to check _hierarchy.linkage() method. I use pycharm text editor and when I asked for "li

I do not have access to the right _hierarchy.py source file

2015-05-17 Thread pegah Aliz
Hello Everybody, This question seems simple, but I can't find the solution: I use scipy.cluster.hierarchy to do a hierarchical clustering on a set of points using "cosine" similarity metric. As an example, I have: import scipy.cluster.hierarchy as hac import matplotlib.pyplot as plt Points =

Re: Rule of order for dot operators?

2015-05-17 Thread Denis McMahon
On Sun, 17 May 2015 11:45:02 +1000, Steven D'Aprano wrote: > On Sun, 17 May 2015 05:40 am, Thomas 'PointedEars' Lahn wrote: > >> C.D. Reimer wrote: >> >> Who? > > Don't be a dick, Thomas. Thomas is a professional dick, he can't help it, he's been a professional dick for years in php and j

Re: Building CPython

2015-05-17 Thread BartC
On 17/05/2015 13:25, Jonas Wielicki wrote: On 16.05.2015 02:55, Gregory Ewing wrote: BartC wrote: For example, there is a /specific/ byte-code called BINARY_ADD, which then proceeds to call a /generic/ binary-op handler! This throws away the advantage of knowing at byte-code generation time exa

Re: Building CPython

2015-05-17 Thread Jonas Wielicki
On 16.05.2015 02:55, Gregory Ewing wrote: > BartC wrote: >> For example, there is a /specific/ byte-code called BINARY_ADD, which >> then proceeds to call a /generic/ binary-op handler! This throws away >> the advantage of knowing at byte-code generation time exactly which >> operation is needed. >

install 3.4.3 or 3.5.0a4 -immediate fail

2015-05-17 Thread Bernard Baillargeon
Win 8.1pro 64b Both/either of the 64b versions fail on "idle", "python" with 'no encodings' module error. It is there. install had set the path to include install dir & the \scripts subdir. Just uninstalled, will have to try later. Been working this -googling the many