ANN: SfePy 2014.3

2014-09-26 Thread Robert Cimrman

I am pleased to announce release 2014.3 of SfePy.

Description
---

SfePy (simple finite elements in Python) is a software for solving systems of
coupled partial differential equations by the finite element method or by the
isogeometric analysis (preliminary support). It is distributed under the new
BSD license.

Home page: http://sfepy.org
Mailing list: http://groups.google.com/group/sfepy-devel
Git (source) repository, issue tracker, wiki: http://github.com/sfepy

Highlights of this release
--

- isogeometric analysis (IGA) speed-up by C implementation of NURBS basis
  evaluation
- generalized linear combination boundary conditions that work between
  different fields/variables and support non-homogeneous periodic conditions
- non-constant essential boundary conditions given by a function in IGA
- reorganized and improved documentation

For full release notes see http://docs.sfepy.org/doc/release_notes.html#id1
(rather long and technical).

Best regards,
Robert Cimrman and Contributors (*)

(*) Contributors to this release (alphabetical order):

Vladimir Lukes, Matyas Novak, Zhihua Ouyang, Jaroslav Vondrejc
--
https://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


PyDev 3.8.0 Released

2014-09-26 Thread Fabio Zadrozny
What is PyDev?
---

PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and
IronPython development.

It comes with goodies such as code completion, syntax highlighting, syntax
analysis, code analysis, refactor, debug, interactive console, etc.

Details on PyDev: http://pydev.org
Details on its development: http://pydev.blogspot.com


What is LiClipse?
---

LiClipse is a PyDev standalone with goodies such as support for Multiple
cursors, theming and a number of other languages such as Django Templates,
Kivy Language, Mako Templates, Html, Javascript, etc.

It's also a commercial counterpart which helps supporting the development
of PyDev.

Details on LiClipse: http://brainwy.github.io/liclipse/


Release Highlights:
---

* **Important**: PyDev requires Eclipse 3.8 or 4.3 onwards and Java 7! For
older versions, keep using PyDev 2.x (use LiClipse:
http://brainwy.github.io/liclipse for a PyDev standalone with all
requirements bundled).

* **Debugger**

* It's now possible to **attach debugger to running process in Windows
and Linux** (open debug perspective  PyDev  Attach to Process)

* pep8 upgraded to 1.5.7
* Fixed issue in dialog shown when PyDev editor is opened which could lead
to closing the IDE.
* Selecting PyQT API version using sip.setapi no longer fails in debug mode
(PyDev-452).
* Code completion tries to get docstring definition from class before
evaluating property (PyDev-412).
* Internal error error when parsing file with wrong syntax:
java.lang.ClassCastException for invalid dict (PyDev-411).
* runfile was restored in pydevconsole (Ctrl+Alt+Enter is working again).
* **Variables** and **Expressions** views working again when debugging
interactive console (PyDev-446).
* Pressing Shift to debug with Ctrl+F9 test runner now properly works in
Linux (PyDev-444).
* Fixed interpreter configuration when the interpreter prints something
before actually running interpreterInfo.py (PyDev-448).
* Fixed NullPointerException when debugging file without extension.


Cheers,

--
Fabio Zadrozny
--
Software Developer

LiClipse
http://brainwy.github.io/liclipse

PyDev - Python Development Environment for Eclipse
http://pydev.org
http://pydev.blogspot.com
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


TextTest 3.27 - blackbox testing tool

2014-09-26 Thread Geoff Bache
Dear all,

The latest release of TextTest includes
- Support for parallel testing using EC2 cloud
- Packaging and release process should now be smoother
- Now integrates with Git as well and bzr and hg.
- Performance data in HTML reports overhauled
and many other things besides.

Regards,
Geoff Bache

TextTest is a tool for automatic text-based functional testing. This
means running a batch-mode executable in lots of different ways from
the command line, and using the text output produced as a means of
controlling the behavior of that application. As well as being usable
standalone, it is an extendable framework for black-box testing
written in Python. It's also useful as a test management tool wrapping
some other test tool as a test runner.

Homepage: http://www.texttest.org
Download: http://sourceforge.net/projects/texttest
Mailing list: https://lists.sourceforge.net/lists/listinfo/texttest-users
Bugs: https://bugs.launchpad.net/texttest
Source: https://code.launchpad.net/texttest
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: Fuzzy Counter?

2014-09-26 Thread Steven D'Aprano
Ian Kelly wrote:

 On Tue, Sep 23, 2014 at 11:01 PM, Miki Tebeka miki.teb...@gmail.com
 wrote:
 On Tuesday, September 23, 2014 7:33:06 PM UTC+3, Rob Gaddi wrote:

 While you're at it, think
 long and hard about that definition of fuzziness.  If you can make it
 closer to the concept of histogram bins you'll get much better
 performance.
 The problem for me here is that I can't determine the number of bins in
 advance. I'd like to get frequencies. I guess every new (don't have any
 previous equal item) can be a bin.
 
 Then your result depends on the order of your input, which is usually
 not a good thing.
 
 Why would you need to determine the *number* of bins in advance? You
 just need to determine where they start and stop. If for example your
 epsilon is 0.5, you could determine the bins to be at [-0.5, 0.5);
 [0.5, 1.5); [1.5, 2.5); ad infinitum. Then for each actual value you
 encounter, you could calculate the appropriate bin, creating it first
 if it doesn't already exist.

That has the unfortunate implication that:

0.50001 and 1.4 (delta = 0.8)

are considered equal, but:

1.50001 and 1.4 (delta = 0.2)

are considered unequal.



-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


https://www.python.org/ seems to be down

2014-09-26 Thread Gmane
https://www.python.org/ seems to be down when I last checked on 06:45 UTC on
26th Sep 2014.
Anybody else experiencing this problem?

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: https://www.python.org/ seems to be down

2014-09-26 Thread Rock Neurotiko
2014-09-26 8:46 GMT+02:00 Gmane shivaji...@yahoo.com.dmarc.invalid:

 https://www.python.org/



http://www.downforeveryoneorjustme.com/python.org

-- 
Miguel García Lafuente - Rock Neurotiko

Do it, the devil is in the details.
The quieter you are, the more you are able to hear.
Happy Coding. Code with Passion, Decode with Patience.
If we make consistent effort, based on proper education, we can change the
world.

El contenido de este e-mail es privado, no se permite la revelacion del
contenido de este e-mail a gente ajena a él.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: https://www.python.org/ seems to be down

2014-09-26 Thread Chris Angelico
On Fri, Sep 26, 2014 at 4:46 PM, Gmane
shivaji...@yahoo.com.dmarc.invalid wrote:
 https://www.python.org/ seems to be down when I last checked on 06:45 UTC on
 26th Sep 2014.
 Anybody else experiencing this problem?

Working for me. Are you getting DNS failure, HTTP failure, SSL
certificate issues, or what?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: https://www.python.org/ seems to be down

2014-09-26 Thread Gmane
Chris Angelico rosuav at gmail.com writes:

 
 On Fri, Sep 26, 2014 at 4:46 PM, Gmane
 shivaji_tn at yahoo.com.dmarc.invalid wrote:
  https://www.python.org/ seems to be down when I last checked on 06:45 UTC on
  26th Sep 2014.
  Anybody else experiencing this problem?
 
 Working for me. Are you getting DNS failure, HTTP failure, SSL
 certificate issues, or what?
 
 ChrisA
 


I am getting the following error in my Firefox browser (OpenSuse OS):

Secure Connection Failed

An error occurred during a connection to www.python.org. The OCSP response
is not yet valid (contains a date in the future). (Error code:
sec_error_ocsp_future_response)

The page you are trying to view cannot be shown because the authenticity
of the received data could not be verified.
Please contact the web site owners to inform them of this problem.
Alternatively, use the command found in the help menu to report this broken
site.

Shiva

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: https://www.python.org/ seems to be down

2014-09-26 Thread Rock Neurotiko
2014-09-26 9:05 GMT+02:00 Gmane shivaji...@yahoo.com.dmarc.invalid:

 Chris Angelico rosuav at gmail.com writes:

 I am getting the following error in my Firefox browser (OpenSuse OS):

 Secure Connection Failed

 An error occurred during a connection to www.python.org. The OCSP response
 is not yet valid (contains a date in the future). (Error code:
 sec_error_ocsp_future_response)

 The page you are trying to view cannot be shown because the
 authenticity
 of the received data could not be verified.
 Please contact the web site owners to inform them of this problem.
 Alternatively, use the command found in the help menu to report this broken
 site.

 Shiva

 --
 https://mail.python.org/mailman/listinfo/python-list



Check your local date, usually that happens when you don't have it right.


-- 
Miguel García Lafuente - Rock Neurotiko

Do it, the devil is in the details.
The quieter you are, the more you are able to hear.
Happy Coding. Code with Passion, Decode with Patience.
If we make consistent effort, based on proper education, we can change the
world.

El contenido de este e-mail es privado, no se permite la revelacion del
contenido de este e-mail a gente ajena a él.
-- 
https://mail.python.org/mailman/listinfo/python-list


joining thread hangs unexpectedly

2014-09-26 Thread Christian Calderon
I am working on a personal project that helps minecraft clients connect to
minecraft servers using tor hidden services. I am handling the client
connection in a separate thread, but when I try to join the threads they
hang. The problem is in the file called hiddencraft.py, in the function
main at the end, in the finally clause at the bottom. Can anyone tell me
what I am doing wrong?

https://github.com/ChrisCalderon/hiddencraft
-- 
https://mail.python.org/mailman/listinfo/python-list


Re:https://www.python.org/ seems to be down

2014-09-26 Thread Dang Zhiqiang
Working for me, In beijing is OK.




At 2014-09-26 14:46:15, Gmane shivaji...@yahoo.com.dmarc.invalid wrote:
https://www.python.org/ seems to be down when I last checked on 06:45 UTC on
26th Sep 2014.
Anybody else experiencing this problem?

-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: https://www.python.org/ seems to be down

2014-09-26 Thread Gmane
Hi, 

Thanks  - that was the problemincorrect system date/time. The system
date time and hardware date time were off. Adjusted the system time to use
one of the online time servers and then used hwclock --systohc (as a root
user) to set the hardware clock.

But it is weird that the data from a website fails to render because of
incorrect system date.

Thanks,
Shiva

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: https://www.python.org/ seems to be down

2014-09-26 Thread Rock Neurotiko
2014-09-26 9:25 GMT+02:00 Gmane shivaji...@yahoo.com.dmarc.invalid:

 Hi,

 Thanks  - that was the problemincorrect system date/time. The system
 date time and hardware date time were off. Adjusted the system time to use
 one of the online time servers and then used hwclock --systohc (as a root
 user) to set the hardware clock.

 But it is weird that the data from a website fails to render because of
 incorrect system date.

 Thanks,
 Shiva

 --
 https://mail.python.org/mailman/listinfo/python-list


Doesn't fails the render of the data, fails the verification of the SSL
certificate, all certificates have an start and end date, if you are not in
that range, your browser don't verify it (that's to prevent malicious SSL
certs).

-- 
Miguel García Lafuente - Rock Neurotiko

Do it, the devil is in the details.
The quieter you are, the more you are able to hear.
Happy Coding. Code with Passion, Decode with Patience.
If we make consistent effort, based on proper education, we can change the
world.

El contenido de este e-mail es privado, no se permite la revelacion del
contenido de este e-mail a gente ajena a él.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: https://www.python.org/ seems to be down

2014-09-26 Thread Chris Angelico
On Fri, Sep 26, 2014 at 5:31 PM, Rock Neurotiko
miguelglafue...@gmail.com wrote:
 Doesn't fails the render of the data, fails the verification of the SSL
 certificate, all certificates have an start and end date, if you are not in
 that range, your browser don't verify it (that's to prevent malicious SSL
 certs).

Precisely. Normally, if you get an error about the date range, the
best thing to do is check the cert's validity dates; if it looks like
it ought to be valid, check your system date :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


any way to tell at runtime whether a callable is implemented in Python or C ?

2014-09-26 Thread Wolfgang Maier

Hi,
is there any reliable and inexpensive way to inspect a callable from 
running Python code to learn whether it is implemented in Python or C 
before calling into it ?


Thanks,
Wolfgang

--
https://mail.python.org/mailman/listinfo/python-list


Re: any way to tell at runtime whether a callable is implemented in Python or C ?

2014-09-26 Thread Stefan Behnel
Wolfgang Maier schrieb am 26.09.2014 um 09:47:
 is there any reliable and inexpensive way to inspect a callable from
 running Python code to learn whether it is implemented in Python or C
 before calling into it ?

Not really. Both can have very different types and very different
interfaces. There are types, classes, functions, methods, objects with a
dedicated __call__() method, ... Any of them can be implemented in Python
or C (or other native languages, or a mix of more than one language).

What's your use case? There might be other ways to achieve what you want.

Stefan


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fuzzy Counter?

2014-09-26 Thread Miki Tebeka
Greetings,

On Wednesday, September 24, 2014 5:57:15 PM UTC+3, Ian wrote:
 Then your result depends on the order of your input, which is usually
 not a good thing.
As stated in previous reply - I'm OK with that.

 Why would you need to determine the *number* of bins in advance? You
 just need to determine where they start and stop. If for example your
 epsilon is 0.5, you could determine the bins to be at [-0.5, 0.5);
 [0.5, 1.5); [1.5, 2.5); ad infinitum. Then for each actual value you
 encounter, you could calculate the appropriate bin, creating it first
 if it doesn't already exist.
I see what you mean. I thought you mean histogram like bins where you usually 
state the number of bins in advance.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: any way to tell at runtime whether a callable is implemented in Python or C ?

2014-09-26 Thread Chris Angelico
On Fri, Sep 26, 2014 at 5:47 PM, Wolfgang Maier
wolfgang.ma...@biologie.uni-freiburg.de wrote:
 Hi,
 is there any reliable and inexpensive way to inspect a callable from running
 Python code to learn whether it is implemented in Python or C before calling
 into it ?

I'm not sure you can say for absolute certain, but the presence of a
__code__ attribute is strongly suggestive that there's Python code
behind the function. That might be good enough for your purposes.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Flask and Python 3

2014-09-26 Thread Jean-Michel Pichavant
- Original Message -
 From: Chris Angelico ros...@gmail.com
 Cc: Python python-list@python.org
 Sent: Friday, 26 September, 2014 1:55:51 AM
 Subject: Re: Flask and Python 3
 
 On Fri, Sep 26, 2014 at 4:35 AM, Juan Christian
 juan0christ...@gmail.com wrote:
  when I say video tutorial, it's implied that every video that I
  talked about
  have 1. The source-code (if programming/code related), 2. The
  transcripts
  and in some cases even 3. PDF version of the video.
 
 I've almost never seen videos that have all of that - and certainly
 not enough to *imply* that about the term.
 
 ChrisA
 --
 https://mail.python.org/mailman/listinfo/python-list

Though I'm never using videos to learn, they probably can benefit some people.

Ask you this question : is there a major difference between videos and 
presentations, if not how can we justify the money spent on Pycons over the 
years ?

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.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Flask and Python 3

2014-09-26 Thread Rustom Mody
On Friday, September 26, 2014 3:26:34 PM UTC+5:30, Jean-Michel Pichavant wrote:

 Though I'm never using videos to learn, they probably can benefit some people.
 
 Ask you this question : is there a major difference between videos and 
 presentations, if not how can we justify the money spent on Pycons over the 
 years ?

There is all sorts of buzz nowadays about left-vs-right brain and 
correspondingly how combined visual+textual (aka right+left) may be better than 
using only one approach.

Google throws up stuff like: 
http://www.inspiration.com/sites/default/files/documents/Detailed-Summary.pdf

To the OP:
You dont invite chiding because of using videos but because of comments like:

 I didn't learn debug with Flask yet. Only in the next videos.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Flask and Python 3

2014-09-26 Thread Ned Batchelder

On 9/25/14 2:26 PM, Chris “Kwpolska” Warrick wrote:

On Thu, Sep 25, 2014 at 8:18 PM, Juan Christian
juan0christ...@gmail.com wrote:

The thing is, it’s text.  I suppose I could use some text-to-speech
software to provide you with a video tutorial version of that.



No, you can't, if you think a video tutorial is only that, I'm afraid to
tell that you only saw terrible courses/tutorials in your life.


Go on, show me a good video tutorial.  One that is quick to consume,
and one I can come back to at any time I please (within reasonable
bounds).  I can just open a text-based tutorial and use my browser’s
search capabilities (or a Table of Contents or an index in an analog
book) to find the precise bit of knowledge I need.  You can’t easily
do that with video tutorials.

Also, video tutorials for code (as well as analog books) lack a very
important feature: copy-paste.  Nobody likes retyping large passages
of code.  Especially because it’s error-prone.



Chris, you are trying to convince the OP that videos are a bad way to 
learn, after the OP has told you that it is his part of his preferred 
way to learn.  Seriously? Do you really think you know what is best for 
everyone?  Different people learn in different ways, and there could be 
a large generational component at work here.


It's clear that you prefer text content to video content.  I do too. 
Lots of people do.  But videos are popular also.


Can't we just stick to trying to help people with Python, and let them 
make other decisions for themselves?


--
Ned Batchelder, http://nedbatchelder.com

--
https://mail.python.org/mailman/listinfo/python-list


Re: any way to tell at runtime whether a callable is implemented in Python or C ?

2014-09-26 Thread Stefan Behnel
Chris Angelico schrieb am 26.09.2014 um 10:42:
 On Fri, Sep 26, 2014 at 5:47 PM, Wolfgang Maier wrote:
 is there any reliable and inexpensive way to inspect a callable from running
 Python code to learn whether it is implemented in Python or C before calling
 into it ?
 
 I'm not sure you can say for absolute certain, but the presence of a
 __code__ attribute is strongly suggestive that there's Python code
 behind the function. That might be good enough for your purposes.

Cython implemented native functions have a __code__ attribute, too. Their
current __code__.co_code attribute is empty (no bytecode), but I wouldn't
rely on that for all times either.

Stefan


-- 
https://mail.python.org/mailman/listinfo/python-list


PyCli : Need some reference to good books or tutorials on pycli

2014-09-26 Thread vijnaana
Hi Folks,

I need to develop a CLI (PyCli or similar)on Linux.
To be more specific to develop Quagga(open source routing software) like
commands using python instead of C.

Need some good reference material for the same.

P.S google didn't help

Thank You!
Vij
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: joining thread hangs unexpectedly

2014-09-26 Thread Ian Kelly
On Thu, Sep 25, 2014 at 11:45 PM, Christian Calderon
calderon.christian...@gmail.com wrote:
 I am working on a personal project that helps minecraft clients connect to
 minecraft servers using tor hidden services. I am handling the client
 connection in a separate thread, but when I try to join the threads they
 hang. The problem is in the file called hiddencraft.py, in the function main
 at the end, in the finally clause at the bottom. Can anyone tell me what I
 am doing wrong?

 https://github.com/ChrisCalderon/hiddencraft

You're creating a separate Queue for each thread but when you store
each one in the queue_ variable you're replacing the previous one, so
when you go to kill them you only ever send the die command to the
last thread created.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PyCli : Need some reference to good books or tutorials on pycli

2014-09-26 Thread Michael Torrie
On 09/26/2014 06:54 AM, vijna...@gmail.com wrote:
 Hi Folks,
 
 I need to develop a CLI (PyCli or similar)on Linux.
 To be more specific to develop Quagga(open source routing software) like
 commands using python instead of C.
 
 Need some good reference material for the same.
 
 P.S google didn't help

Wait, are you asking about making a command-line interface in Python?
If so, then there are a number of aspects you can google for:
- command line argument parsing.  See python docs on argparse
- A read/eval print loop using custom keywords and syntax, if you want
your program to be interactive.
   - you'll need to use readline to handle line editing
   - something to parse line input.  PyParsing perhaps.  Or some other
lexical parser, or manually do the parsing you need to do with .split()
or regular expressions.
   - possibly curses for doing screen output, though print() is probably
sufficient.

Except for pyparsing everything is in the standard library.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PyCli : Need some reference to good books or tutorials on pycli

2014-09-26 Thread Michael Torrie
On 09/26/2014 06:54 AM, vijna...@gmail.com wrote:
 Hi Folks,
 
 I need to develop a CLI (PyCli or similar)on Linux.
 To be more specific to develop Quagga(open source routing software) like
 commands using python instead of C.
 
 Need some good reference material for the same.
 
 P.S google didn't help

I don't doubt that.  I don't understand what you're asking either.  Can
you be more specific?  I've never heard of PyCli.  What is it?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PyCli : Need some reference to good books or tutorials on pycli

2014-09-26 Thread Jean-Michel Pichavant
- Original Message -
 From: vijna...@gmail.com
 To: python-list@python.org
 Sent: Friday, 26 September, 2014 2:54:48 PM
 Subject: PyCli : Need some reference to good books or tutorials on pycli
 
 Hi Folks,
 
 I need to develop a CLI (PyCli or similar)on Linux.
 To be more specific to develop Quagga(open source routing software)
 like
 commands using python instead of C.
 
 Need some good reference material for the same.
 
 P.S google didn't help
 
 Thank You!
 Vij


Have you considered using ipython ?

I have built a CLI on top of that and it's pretty easy and effective, and it 
requires almost no dev. The following code is untested but it should give you 
an idea of what I mean.

cli.py:

import IPython
import yourApi

# explict exposure
foo = yourApi.foo
bar = yourApi.bar

# or you can expose all the content of yourApi
api = yourApi

# delete unwanted names
del yourApi
del IPython

# start the interactive CLI
IPython.frontend.terminal.embed.InteractiveShellEmbed(banner1='Hello Word', 
exit_msg='bbye')()

Regards,

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.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: any way to tell at runtime whether a callable is implemented in Python or C ?

2014-09-26 Thread Ian Kelly
On Fri, Sep 26, 2014 at 6:12 AM, Stefan Behnel stefan...@behnel.de wrote:
 Chris Angelico schrieb am 26.09.2014 um 10:42:
 On Fri, Sep 26, 2014 at 5:47 PM, Wolfgang Maier wrote:
 is there any reliable and inexpensive way to inspect a callable from running
 Python code to learn whether it is implemented in Python or C before calling
 into it ?

 I'm not sure you can say for absolute certain, but the presence of a
 __code__ attribute is strongly suggestive that there's Python code
 behind the function. That might be good enough for your purposes.

 Cython implemented native functions have a __code__ attribute, too. Their
 current __code__.co_code attribute is empty (no bytecode), but I wouldn't
 rely on that for all times either.

Meanwhile, Python classes and objects with __call__ methods have no
__code__ attribute.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fuzzy Counter?

2014-09-26 Thread Ethan Furman

On 09/23/2014 09:32 AM, Rob Gaddi wrote:

On Tue, 23 Sep 2014 05:34:19 -0700 (PDT) Miki Tebeka wrote:


Before I start writing my own. Is there something like collections.Counter (fore 
frequencies) that does fuzzy matching?

Meaning x is considered equal to y if abs(x - y)  epsilon. (x, y and my case 
will be numpy.array).


You'll probably have to write that yourself.  While you're at it, think
long and hard about that definition of fuzziness.  If you can make it
closer to the concept of histogram bins you'll get much better
performance.


You might want to take a look at the reference implementation for PEP 455 [1].  If you can decide on a method to 
transform your keys (such as taking the floor, or the half, or something like that), then that should work as is.


--
~Ethan~


[1] http://legacy.python.org/dev/peps/pep-0455/
--
https://mail.python.org/mailman/listinfo/python-list


Re: [PyQt] Automatic Crash Reporting

2014-09-26 Thread Detlev Offenbach
Hi,

I did this myself for the eric IDE. Depending upon your needs it is really 
simple. 
Just check the eric5.py main script. (http://eric-ide.python-projects.org)

Detlev

On Thursday 25 September 2014, 04:15:53 Timothy W. Grove wrote:
 Can anyone recommend a good automatic crash reporting module that would
 work nicely with a python3/pyqt4 application? Thanks.
 
 Tim
 ___
 PyQt mailing listp...@riverbankcomputing.com
 http://www.riverbankcomputing.com/mailman/listinfo/pyqt-- 
*Detlev Offenbach*
det...@die-offenbachs.de
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fuzzy Counter?

2014-09-26 Thread random832
On Wed, Sep 24, 2014, at 00:57, Miki Tebeka wrote:
 On Tuesday, September 23, 2014 4:37:10 PM UTC+3, Peter Otten wrote:
  x eq y 
  y eq z
  not (x eq z)
  
  where eq is the test given above -- should x, y, and z land in the same bin?
 Yeah, I know the counting depends on the order of items. But I'm OK with
 that.

It doesn't just depend on the order. If you put x and z in first
(creating two bins), then which one does y go in after?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Flask and Python 3

2014-09-26 Thread Terry Reedy

On 9/26/2014 7:41 AM, Ned Batchelder wrote:


Can't we just stick to trying to help people with Python, and let them
make other decisions for themselves?


I agree. The OP should watch the video on debugging, and the off-topic 
discussion of video versus text should end.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: Fuzzy Counter?

2014-09-26 Thread Rob Gaddi
On Tue, 23 Sep 2014 22:01:51 -0700 (PDT)
Miki Tebeka miki.teb...@gmail.com wrote:

 On Tuesday, September 23, 2014 7:33:06 PM UTC+3, Rob Gaddi wrote:
 
  While you're at it, think
  long and hard about that definition of fuzziness.  If you can make it
  closer to the concept of histogram bins you'll get much better
  performance.  
 The problem for me here is that I can't determine the number of bins in 
 advance. I'd like to get frequencies. I guess every new (don't have any 
 previous equal item) can be a bin.
 
  TL;DR you need to think very hard about your problem definition and
  what you want to happen before you actually try to implement this.
 Always a good advice :) I'm actually implementing algorithm for someone else 
 (in the bio world where I know very little about).

See, THERE's your problem.  You've got a scientist trying to make
prescriptions for an engineering problem.  He's given you a fuzzy
description of the sort of thing he's trying to do.  Your job is to
turn that fuzzy description into a concrete, actual algorithm
before you even write a single line of code, which means understanding
what the data is, and what the desired result of that data is.  Because
the thing you keep trying to do, with all of its order dependencies
fundamentally CANNOT be right, regardless of what the squishy scientist
tells you.

The histogram bin solution that everyone keeps trying to steer you
towards is almost certainly what you really want.  Epsilon is your
resolution.  You cannot resolve any information below your resolution
limit.  Yes, 1.49 and 1.51 wind up in different bins, whereas 1.51 and
2.49 are in the same one, but that's what it means to have a resolution
of 1; you can't say anything about whether any given count in the 2,
plus or minus a bit bin is very nearly 1 or very nearly 3.

This doesn't require you to know the number of bins in advance, you can
just create and fill them as needed.  That said, you're trying to solve
a physical problem, and so it has physical limits.  Your biologist
should be able to give you an order of magnitude estimate of how many
bins you're expecting, and what the ultimate shape is expected to
look like.  Normally distributed?  Wildly bimodal?  Is the overall span
of data going to span 10 epsilon or 10,000 epsilon?  If there are going
to be a ton of bins, you may be better served by putting 1/3 of a count
into bins n-1, n, and n+1 rather than just in bin n; it's the
equivalent of squinting a bit when you look at the bins.

But you have to understand the problem to solve it.

-- 
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: any way to tell at runtime whether a callable is implemented in Python or C ?

2014-09-26 Thread Terry Reedy

On 9/26/2014 12:10 PM, Ian Kelly wrote:

On Fri, Sep 26, 2014 at 6:12 AM, Stefan Behnel stefan...@behnel.de wrote:



On Fri, Sep 26, 2014 at 5:47 PM, Wolfgang Maier wrote:

is there any reliable and inexpensive way to inspect a callable from running
Python code to learn whether it is implemented in Python or C before calling
into it ?


Implementation languages are not part of the language definition and are 
not limited to Python and C.  Some CPython extension modules have used 
Fortran (perhaps with a very thin C layer).


One way I can think of: apply inspect.signature. If it fails, the 
function is not coded in Python.  If it succeeds, pass a correct number 
of args but invalid types/values (float('nan') for instance), catch the 
exception, and see if the traceback contains a line of Python code from 
the function.  (But I am not sure what happens if the function was coded 
in Python but the code is not available.)


As someone already asked, why?


Cython implemented native functions have a __code__ attribute, too. Their
current __code__.co_code attribute is empty (no bytecode), but I wouldn't
rely on that for all times either.


Meanwhile, Python classes and objects with __call__ methods have no
__code__ attribute.


Also, Python functions can call C functions, and many builtin functions 
take Python functions as arguments.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: Fuzzy Counter?

2014-09-26 Thread random832
On Fri, Sep 26, 2014, at 14:30, Rob Gaddi wrote:
 The histogram bin solution that everyone keeps trying to steer you
 towards is almost certainly what you really want.  Epsilon is your
 resolution.  You cannot resolve any information below your resolution
 limit.  Yes, 1.49 and 1.51 wind up in different bins, whereas 1.51 and
 2.49 are in the same one, but that's what it means to have a resolution
 of 1; you can't say anything about whether any given count in the 2,
 plus or minus a bit bin is very nearly 1 or very nearly 3.

You could antialias the values, though. 1.49 results in a value that
is 51% in the 1 bin, and 49% in the 2 bin. count[1] += 0.51,
count[2] += 0.49. You could even spread each value across a larger
number of smaller bins.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fuzzy Counter?

2014-09-26 Thread Rob Gaddi
On Fri, 26 Sep 2014 15:10:43 -0400
random...@fastmail.us wrote:

 On Fri, Sep 26, 2014, at 14:30, Rob Gaddi wrote:
  The histogram bin solution that everyone keeps trying to steer you
  towards is almost certainly what you really want.  Epsilon is your
  resolution.  You cannot resolve any information below your resolution
  limit.  Yes, 1.49 and 1.51 wind up in different bins, whereas 1.51 and
  2.49 are in the same one, but that's what it means to have a resolution
  of 1; you can't say anything about whether any given count in the 2,
  plus or minus a bit bin is very nearly 1 or very nearly 3.
 
 You could antialias the values, though. 1.49 results in a value that
 is 51% in the 1 bin, and 49% in the 2 bin. count[1] += 0.51,
 count[2] += 0.49. You could even spread each value across a larger
 number of smaller bins.

Right, but there's still that stateless determination of which bin (or
bins) 1.49 goes in.  The history of the bins is irrelevant, which is
the important part.

-- 
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.
-- 
https://mail.python.org/mailman/listinfo/python-list


Microsoft Visual C++ Compiler for Python 2.7

2014-09-26 Thread Mark Lawrence
I thought that Windows users who don't follow Python-dev might be 
interested in this announcement 
https://mail.python.org/pipermail/python-dev/2014-September/136499.html, 
the rest of you can look away now :)


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Want to win a 500 tablet?

2014-09-26 Thread Seymore4Head
I am taking An Introduction to Interactive Programming in Python at
coursera.org.  From their announcments page:

Week one of the video contest is open

For those of you that are interested in helping your peers, the
student video tutorial competition is an excellent opportunity. The
week one submission thread is up in the student video tutorial
forum. Feel free to browse the current tutorials or make your own.
The deadline for submission of this week's videos is 23:00 UTC on
Thursday. The overall winner of this competition will receive a $500
tablet computer so give it a try if you are interested!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Want to win a 500 tablet?

2014-09-26 Thread Seymore4Head
On Fri, 26 Sep 2014 18:55:54 -0400, Seymore4Head
Seymore4Head@Hotmail.invalid wrote:

I am taking An Introduction to Interactive Programming in Python at
coursera.org.  From their announcments page:

Week one of the video contest is open

For those of you that are interested in helping your peers, the
student video tutorial competition is an excellent opportunity. The
week one submission thread is up in the student video tutorial
forum. Feel free to browse the current tutorials or make your own.
The deadline for submission of this week's videos is 23:00 UTC on
Thursday. The overall winner of this competition will receive a $500
tablet computer so give it a try if you are interested!

BTW this was the most informative tutorial I found.
https://www.youtube.com/watch?v=LpTzLnryDq8
-- 
https://mail.python.org/mailman/listinfo/python-list


pip install virtualenvwrapper complaining there's no module named core

2014-09-26 Thread Tim Chase
I'm at a bit of a loss trying to figure out where this mysterious
core module is.  FWIW, this is a hosted server where python is
2.4, but 2.6 is available if named.  Full steps were as follows:

1) Pull down get-pip.py as directed

wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py

2) Okay, raw.github.com serves a cert that wget doesn't like
 because the cert is assigned to just github.com (grumble)

wget --no-check-certificate 
https://raw.github.com/pypa/pip/master/contrib/get-pip.py

3) Run it, specifying that I want things to get installed
 in my home/user directory:

 python2.6 get-pip.py --user

4) Okay, let's get me some virutalenv (works fine)

 pip2.6 install --user virtualenv

5) Okay, let's get me some virutalenvwrapper

 pip2.6 install --user virtualenvwrapper

This is where things fall over (~/.pip/pip.log output below) with
the inability to import a module named core.

Where am I going wrong, or what am I missing?

I have a nagging feeling that it's either a 2.4-vs-2.6 conflict,
or possibly some PYTHONPATH (currently unset) issue that I missed.

-tkc

--

Downloading/unpacking virtualenvwrapper
  Running setup.py (path:/tmp/pip_build_tim/virtualenvwrapper/setup.py) 
egg_info for package virtualenvwrapper

Installed /tmp/pip_build_tim/virtualenvwrapper/pbr-0.10.0-py2.6.egg
Searching for pip
Reading http://pypi.python.org/simple/pip/
Best match: pip 1.5.6
Downloading 
https://pypi.python.org/packages/source/p/pip/pip-1.5.6.tar.gz#md5=01026f87978932060cc86c1dc527903e
Processing pip-1.5.6.tar.gz
Running pip-1.5.6/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-CcQHLI/pip-1.5.6/egg-dist-tmp-8B3Dq1
warning: no files found matching 'pip/cacert.pem'
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.rst' found under 
directory 'docs/_build'
no previously-included directories found matching 'docs/_build/_sources'

Installed /tmp/pip_build_tim/virtualenvwrapper/pip-1.5.6-py2.6.egg

/usr/local/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/dist.py:245:
 UserWarning: Module pbr was already imported from 
/tmp/easy_install-7dd_Tz/pbr-0.10.0/pbr/__init__.py, but 
/tmp/pip_build_tim/virtualenvwrapper/pbr-0.10.0-py2.6.egg is being added to 
sys.path
Traceback (most recent call last):
  File string, line 17, in module
  File /tmp/pip_build_tim/virtualenvwrapper/setup.py, line 7, in module
pbr=True,
  File /usr/local/lib/python2.6/distutils/core.py, line 113, in setup
_setup_distribution = dist = klass(attrs)
  File build/bdist.linux-i686/egg/setuptools/dist.py, line 223, in 
__init__
  File /usr/local/lib/python2.6/distutils/dist.py, line 270, in __init__
self.finalize_options()
  File build/bdist.linux-i686/egg/setuptools/dist.py, line 256, in 
finalize_options
  File build/bdist.linux-i686/egg/pkg_resources.py, line 1913, in load
ImportError: No module named core
Complete output from command python setup.py egg_info:


Installed /tmp/pip_build_tim/virtualenvwrapper/pbr-0.10.0-py2.6.egg

Searching for pip

Reading http://pypi.python.org/simple/pip/

Best match: pip 1.5.6

Downloading 
https://pypi.python.org/packages/source/p/pip/pip-1.5.6.tar.gz#md5=01026f87978932060cc86c1dc527903e

Processing pip-1.5.6.tar.gz

Running pip-1.5.6/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-CcQHLI/pip-1.5.6/egg-dist-tmp-8B3Dq1

warning: no files found matching 'pip/cacert.pem'

warning: no files found matching '*.html' under directory 'docs'

warning: no previously-included files matching '*.rst' found under directory 
'docs/_build'

no previously-included directories found matching 'docs/_build/_sources'



Installed /tmp/pip_build_tim/virtualenvwrapper/pip-1.5.6-py2.6.egg

/usr/local/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/dist.py:245:
 UserWarning: Module pbr was already imported from 
/tmp/easy_install-7dd_Tz/pbr-0.10.0/pbr/__init__.py, but 
/tmp/pip_build_tim/virtualenvwrapper/pbr-0.10.0-py2.6.egg is being added to 
sys.path

Traceback (most recent call last):

  File string, line 17, in module

  File /tmp/pip_build_tim/virtualenvwrapper/setup.py, line 7, in module

pbr=True,

  File /usr/local/lib/python2.6/distutils/core.py, line 113, in setup

_setup_distribution = dist = klass(attrs)

  File build/bdist.linux-i686/egg/setuptools/dist.py, line 223, in __init__

  File /usr/local/lib/python2.6/distutils/dist.py, line 270, in __init__

self.finalize_options()

  File build/bdist.linux-i686/egg/setuptools/dist.py, line 256, in 
finalize_options

  File build/bdist.linux-i686/egg/pkg_resources.py, line 1913, in load

ImportError: No module named core


Cleaning up...
Command python setup.py egg_info failed with error code 1 in 

Re:Microsoft Visual C++ Compiler for Python 2.7

2014-09-26 Thread Dave Angel
Mark Lawrence breamore...@yahoo.co.uk Wrote in message:
 I thought that Windows users who don't follow Python-dev might be 
 interested in this announcement 
 https://mail.python.org/pipermail/python-dev/2014-September/136499.html, 
 the rest of you can look away now :)
 
 -- 
 My fellow Pythonistas, ask not what our language can do for you, ask
 what you can do for our language.
 
 Mark Lawrence
 
 


 Not Found

The requested URL /pipermail/python-dev/2014-Sep
tember/136499.html, was not found on this server.


-- 
DaveA

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Microsoft Visual C++ Compiler for Python 2.7

2014-09-26 Thread Ethan Furman

On 09/26/2014 06:30 PM, Dave Angel wrote:


  Not Found


Worked fine for me.

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


Leap year

2014-09-26 Thread Seymore4Head
Still practicing.  Since this is listed as a Pseudocode, I assume this
is a good way to explain something.  That means I can also assume my
logic is fading with age.
http://en.wikipedia.org/wiki/Leap_year#Algorithm

Me trying to look at the algorithm, it would lead me to try something
like:
if year % 4 !=0:
return False
elif year % 100 !=0:
return True
elif year % 400 !=0:
return False

   Since it is a practice problem I have the answer:
def is_leap_year(year):
return ((year % 4) == 0 and ((year % 100) != 0 or (year % 400) == 0))

I didn't have any problem when I did this:

if year % 400 == 0:
print (Not leap year)
elif year % 100 == 0:
print (Leap year)
elif year % 4 == 0:
print (Leap year)
else:
print (Not leap year)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Leap year

2014-09-26 Thread Gene Heskett
On Friday 26 September 2014 23:49:43 Seymore4Head did opine
And Gene did reply:
 Still practicing.  Since this is listed as a Pseudocode, I assume this
 is a good way to explain something.  That means I can also assume my
 logic is fading with age.
 http://en.wikipedia.org/wiki/Leap_year#Algorithm
 
 Me trying to look at the algorithm, it would lead me to try something
 like:
 if year % 4 !=0:
   return False
 elif year % 100 !=0:
   return True
 elif year % 400 !=0:
   return False
 
    Since it is a practice problem I have the answer:
 def is_leap_year(year):
 return ((year % 4) == 0 and ((year % 100) != 0 or (year % 400) == 0))
 
 I didn't have any problem when I did this:
 
 if year % 400 == 0:
   print (Not leap year)
 elif year % 100 == 0:
   print (Leap year)
 elif year % 4 == 0:
   print (Leap year)
 else:
   print (Not leap year)

Which is, except for language syntax to state it, exactly the same as is 
quoted for this problem in the original KR C manual.  Is there anything 
new?

Cheers, Gene Heskett
-- 
There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order.
-Ed Howdershelt (Author)
Genes Web page http://geneslinuxbox.net:6309/gene
US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Microsoft Visual C++ Compiler for Python 2.7

2014-09-26 Thread Chris Angelico
On Sat, Sep 27, 2014 at 11:30 AM, Dave Angel da...@davea.name wrote:
  Not Found

 The requested URL /pipermail/python-dev/2014-Sep
 tember/136499.html, was not found on this server.

Someone forgot to be careful of posting URLs with punctuation near them...

Trim off the comma and it'll work:
https://mail.python.org/pipermail/python-dev/2014-September/136499.html

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue15799] httplib client and statusline

2014-09-26 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Sorry that I did not get involved earlier.

It is difficult to prove any problem with the current behavior and it is 
rightly closed. The issue which was originally raised seems to me a cosmetic 
one, which won't get exhibited as well.

Here is  simple test case and the output with the current behavior.

# testcases.py

testcases = [HTTP/1.1 200, HTTP/1.1 200 OK, HTTP/1.1 200  , HTTP/1.1   
200]
for tc in testcases:
try:
version, status, reason = tc.split(None, 2)
print %s (%s,%s,%s) % (tc, version, status, reason)
except ValueError:
version, status = tc.split(None, 1)
print %s (%s, %s) % (tc, version, status)


$ python testcases.py
HTTP/1.1 200 (HTTP/1.1, 200)
HTTP/1.1 200 OK (HTTP/1.1,200,OK)
HTTP/1.1 200   (HTTP/1.1, 200  )
HTTP/1.1   200 (HTTP/1.1, 200)

The problem is the status code (str at the moment) has a trailing spaces. 
And now, the status code is not used as string. Just after the parsing, the 
status is converted to integer, Line 337: status = int(status) and rest of 
urllib and http/client's behavior use status as int rather than as string.

Thanks!

--
type: enhancement - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15799
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19645] decouple unittest assertions from the TestCase class

2014-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here are most popular idioms which deserve special assertion methods:

assertHasAttr(obj, name) == assertTrue(hasattr(obj, name))
assertIsSubclass(type, expected) == assertTrue(issubclass(type, expected))
assertTypeIs(obj, expected) == assertIs(type(obj), expected)
assertTypedEqual(actual, expected) == assertIs(type(actual), type(expected)) 
and assertEqual(actual, expected) # or assertIsInstance(actual, type(expected))?
assertStartsWith(actual, prefix) == assertTrue(s.startswith(prefix))
assertEndsWith(actual, suffix) == assertTrue(s.endswith(suffix))
assertUnorderedSequenceEqual(first, second) == assertTrue(all(x in second for x 
in first)) and assertTrue(all(x in first for x in second)) and 
assertEqual(len(first), len(second))

--
nosy: +serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19645
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19642] shutil to support equivalent of: rm -f /dir/*

2014-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Rather like this:

for n in os.listdir(dirpath):
p = os.path.join(dirpath, n)
if os.path.isdir(p):
shutil.rmtree(p)
else:
os.unlink(p)

--
nosy: +serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19642
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2014-09-26 Thread paul j3

Changes by paul j3 ajipa...@gmail.com:


Added file: http://bugs.python.org/file36728/sample3.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22401
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2014-09-26 Thread paul j3

Changes by paul j3 ajipa...@gmail.com:


Removed file: http://bugs.python.org/file36656/sample3.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22401
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Stefan Behnel

New submission from Stefan Behnel:

The attached patch adds fast paths for PyLong division by 1 and -1, as well as 
dividing 0 by something. This was found helpful for fractions normalisation, as 
the GCD that is divided by can often be |1|, but firing up the whole division 
machinery for this eats a lot of CPU cycles for nothing.

There are currently two test failures in test_long.py because dividing a huge 
number by 1 or -1 no longer raises an OverflowError. This is a behavioural 
change, but I find it acceptable. If others agree, I'll fix the tests and 
submit a new patch.

--
components: Interpreter Core
files: div_by_1_fast_path.patch
keywords: patch
messages: 227590
nosy: mark.dickinson, pitrou, scoder, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Optimise PyLong division by 1 or -1
type: performance
versions: Python 3.5
Added file: http://bugs.python.org/file36729/div_by_1_fast_path.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22464] Speed up fractions implementation

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

I tried it, but it seems better to open a new ticket for this as there are 
behavioural changes. See #22501.

--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22464
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22143] rlcompleter.Completer has duplicate matches

2014-09-26 Thread Claudiu Popa

Claudiu Popa added the comment:

The patch looks good. Could you add a test?

--
nosy: +Claudiu.Popa

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22143
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16512] imghdr doesn't recognize variant jpeg formats

2014-09-26 Thread Claudiu Popa

Changes by Claudiu Popa pcmantic...@gmail.com:


--
stage: patch review - test needed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16512
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22464] Speed up fractions implementation

2014-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Please do not use is for number comparison. This can be broken unexpectedly 
in future or on alternative implementation.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22464
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Perhaps it would be worth to special case multiplying on 0, 1 and -1 and adding 
0, 1 and -1 too.

--
stage:  - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread STINNER Victor

STINNER Victor added the comment:

Any optimization requires a benchmark. What is the speedup?

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread STINNER Victor

STINNER Victor added the comment:

I proposed an optimization for x  0 (as part of a larger patch to optimize 
2 ** x) but the issue was rejected:
http://bugs.python.org/issue21420#msg217802

Mark Dickson wrote (msg217863):
There are many, many tiny optimisations we *could* be making in 
Objects/longobject.c; each of those potential optimisations adds to the cost of 
maintaining the code, detracts from readability, and potentially even slows 
down the common cases fractionally.  In general, I think we should only be 
applying this sort of optimization when there's a clear benefit to real-world 
code.  I don't think this one crosses that line.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

Attaching a similar patch for long_mul().

--
Added file: http://bugs.python.org/file36730/mul_by_1_fast_path.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

 Any optimization requires a benchmark. What is the speedup?

I gave numbers in ticket #22464.


Since many Fraction input values can already be normalised for some reason, the 
following change shaves off almost 30% of the calls to 
PyNumber_InPlaceFloorDivide() in the telco benchmark during Fraction 
instantiation according to callgrind, thus saving 20% of the CPU instructions 
that go into tp_new().


I then proposed to move this into the PyLong type in general, rather than 
letting Fraction itself do it less efficiently.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

@Serhiy: moving the fast path into l_divmod() has the disadvantage of making it 
even more complex because we'd then also want to determine the modulus, but 
only if requested, and it can be 1, 0 or -1, depending on the second value. 
Sounds like a lot more if's.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

Combined patch for both mul and div that fixes the return value of 
long_true_div(), as found by Serhiy, and removes the useless change in 
long_divrem(), as found by Antoine. Thanks!

All test_long.py tests pass now.

--
Added file: http://bugs.python.org/file36731/mul_div_by_1_fast_path.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

@Serhiy: please ignore my comment in msg227599. I'll submit a patch that moves 
the specialisation to l_divmod().

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

Thanks for the reviews, here's a new patch.

--
Added file: http://bugs.python.org/file36732/mul_div_by_1_fast_path_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22141] rlcompleter.Completer matches too much

2014-09-26 Thread Lorenz Quack

Lorenz Quack added the comment:

Oops!

tests sound like a good Idea.
I realized my fix doesn't work.
I had not noticed this before because in my application I had already 
implemented a workaround :/

The problem with catching the trailing parenthesis is that the group then does 
not match the attribute of the class.
I'll be back with a new patch and test case.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22141
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Stefan Behnel

Changes by Stefan Behnel sco...@users.sourceforge.net:


Removed file: http://bugs.python.org/file36732/mul_div_by_1_fast_path_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

Sorry, last patch version contained a use before type check bug.

--
Added file: http://bugs.python.org/file36733/mul_div_by_1_fast_path_3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

Here is an incremental patch that adds fast paths for adding and subtracting 0.

Question: the module calls long_long() in some places (e.g. long_abs()) and 
thus forces the return type to be exactly a PyLong and not a subtype. My 
changes use a plain incref+return input value in some places. Should they 
call long_long() on it instead?

--
Added file: http://bugs.python.org/file36734/add_sub_0_fast_path.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13611] Integrate ElementC14N module into xml.etree package

2014-09-26 Thread Chris E

Chris E added the comment:

Whilst in most cases this would be correct, in this case it looks like the 
original contributor took a subset of what the original author wrote and put it 
into the python libraries.

Until relatively recently the ElementTree.py file included a stanza that 
attempted to import the ElementC14N module and conditionally set up the 'c14n' 
key value in _serialize

--
nosy: +cbz

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13611
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 26/09/2014 12:57, Stefan Behnel a écrit :
 
 Question: the module calls long_long() in some places (e.g.
long_abs()) and thus forces the return type to be exactly a PyLong and
not a subtype. My changes use a plain incref+return input value in
some places. Should they call long_long() on it instead?

Ah, yes, they should. The return type should not depend on the input
*values* :-)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8212] A tp_dealloc of a subclassed class cannot resurrect an object

2014-09-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I think PEP 442 makes this request obsolete: you can simply implement 
tp_finalize() and incref the object naturally from there. Kristjan, what do you 
think?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8212
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13611] Integrate ElementC14N module into xml.etree package

2014-09-26 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +eli.bendersky

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13611
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Stefan Behnel

Changes by Stefan Behnel sco...@users.sourceforge.net:


Added file: http://bugs.python.org/file36736/mul_div_by_1_fast_path_3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

Ok, updating both patches.

--
Added file: http://bugs.python.org/file36735/add_sub_0_fast_path_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22197] Allow better verbosity / output control in test cases

2014-09-26 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +rbcollins

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17462] argparse FAQ: how it is different from optparse

2014-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 84313c61e60d by Berker Peksag in branch '3.4':
Issue #17462: Add a paragraph about advantages of argparse over optparse.
https://hg.python.org/cpython/rev/84313c61e60d

New changeset 45e1c0029aff by Berker Peksag in branch 'default':
Issue #17462: Add a paragraph about advantages of argparse over optparse.
https://hg.python.org/cpython/rev/45e1c0029aff

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17462
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

I reran the fractions benchmark over the final result and the overall gain 
turned out to be, well, small. It's a clearly reproducible 2-3% faster. That's 
not bad for the macro impact of a micro-optimisation, but it's not a clear 
argument for throwing more code at it either.

I'll leave it to you to decide.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17462] argparse FAQ: how it is different from optparse

2014-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4eb847e7ddde by Berker Peksag in branch '2.7':
Issue #17462: Add a paragraph about advantages of argparse over optparse.
https://hg.python.org/cpython/rev/4eb847e7ddde

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17462
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17462] argparse FAQ: how it is different from optparse

2014-09-26 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Anastasia.

--
assignee: eric.araujo - berker.peksag
keywords: +easy
nosy: +berker.peksag
resolution:  - fixed
stage: commit review - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17462
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19610] setup.py does not allow a tuple for classifiers

2014-09-26 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
assignee:  - berker.peksag

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19610
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22327] test_gdb failures on Ubuntu 14.10

2014-09-26 Thread Stefan Krah

Stefan Krah added the comment:

I'm seeing the same, it could be an Ubuntu issue:

https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1348275

--
nosy: +skrah

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22327
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16324] MIMEText __init__ does not support Charset instance

2014-09-26 Thread Berker Peksag

Berker Peksag added the comment:

Here's an updated patch.

--
nosy: +berker.peksag
stage:  - patch review
type: behavior - enhancement
versions: +Python 3.5 -Python 3.2
Added file: http://bugs.python.org/file36737/issue16324_v2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16324
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22445] Memoryviews require more strict contiguous checks then necessary

2014-09-26 Thread Stefan Krah

Stefan Krah added the comment:

Ok, here's my take on the situation:

1) As far as Python is concerned, shape[0] == 1 was already special-cased, so
   people could not rely on canonical Fortran or C strides anyway.


2) Accessing an element via strides should be done using PyBuffer_GetPointer(),
   which can of course handle non-canonical strides.


3) Breakage will only affect NumPy users, since practically no one else is
   using multidimensional arrays.


Regarding your option 2b):  I think it may be confusing, the buffer protocol
is already so complicated.


So, I think purity wins here.  If you are sure that all future NumPy versions
will ship with precise contiguity checks, then I'll commit the new patch in 3.5 
(earlier versions should not be changed IMO).


I've moved the checks for 0 in shape[i] to the beginning (len == 0).  I hope
there are no applications that set len incorrectly, but they would be severely
broken anyway.

--
stage:  - patch review
versions: +Python 3.5
Added file: http://bugs.python.org/file36738/issue22445.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22445
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16324] MIMEText __init__ does not support Charset instance

2014-09-26 Thread R. David Murray

R. David Murray added the comment:

The updated patch looks good to me.  Go ahead and commit it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16324
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19642] shutil to support equivalent of: rm -f /dir/*

2014-09-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 rm -rf /dir

Isn't it shutil.rmtree()? Am I missing something?

 rm -f /dir/*

So it should skip dotted files, or remove them?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19642
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22486] Add math.gcd()

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

Thanks, Serhiy. However, something is wrong with the implementation. The 
benchmark runs into an infinite loop (it seems). And so do the previous 
patches. Does it work for you?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22486
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22486] Add math.gcd()

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

I compiled it with 30 bit digits, in case that's relevant. (It might be.)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22486
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22197] Allow better verbosity / output control in test cases

2014-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is the verbose attribute of the test.support module.

--
nosy: +serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22486] Add math.gcd()

2014-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It works to me (compiled with 15-bit digits). Cold you please add debugging 
prints (before and after the call of math.gcd()) and find which operation is 
looping (math.gcd() itself, and for what arguments, or some Python code)?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22486
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22197] Allow better verbosity / output control in test cases

2014-09-26 Thread Ezio Melotti

Ezio Melotti added the comment:

That only works for the CPython test suite (and it's not a public API).

FWIW I'm +1 on the idea, but I would have to see how it will get implemented in 
a patch.

--
stage:  - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22197] Allow better verbosity / output control in test cases

2014-09-26 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22197] Allow better verbosity / output control in test cases

2014-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Usages of test.support.verbose should be replaced by self.verbosity.

As for output buffering, may be replace sys.stdout by file-like object which 
flushes its buffered content to original stdout on failure and discard it on 
success. Or add the self.log file-like object with such behavior and redirect 
all verbose output to it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22197] Allow better verbosity / output control in test cases

2014-09-26 Thread Ezio Melotti

Ezio Melotti added the comment:

 As for output buffering, may be replace sys.stdout by file-like object
 which flushes its buffered content to original stdout on failure and
 discard it on success.

This is what the --buffer option is already supposed to do (I only found out 
about it thanks to this issue, the name is not very indicative of what it 
does...).  IIUC what Antoine is suggesting is having a more fine-grained 
control of the buffering, and the ability to set it from individual test cases 
rather than using a global command line flag or unittest.main(buffer=True) 
(which is only used while executing the test file directly).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, such small gain and only on one specific benchmark not included still in 
standard benchmark suite, looks discourage. May be other benchmarks have gain 
from these changes?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22501] Optimise PyLong division by 1 or -1

2014-09-26 Thread STINNER Victor

STINNER Victor added the comment:

 2-3% faster

3% is not enough to justify the change.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22501
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22197] Allow better verbosity / output control in test cases

2014-09-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Indeed, I'm sorry for suggesting two features in one issue :-)

Feature #1 is self.verbosity (as a read-only variable) on test cases. Sounds 
like a no-brainer, IMHO :-)

Feature #2 is selective enabling of the buffering feature in test cases. This 
rather misnamed features only prints out stdout when the test fails, which is 
useful when you want permanent debug statements that only pollute stdout when 
there is a test failure.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22486] Add math.gcd()

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

This is what hangs for me:

math.gcd(1216342683557601535506311712, 436522681849110124616458784)

a and b keep switching between both values, but otherwise, the loop just 
keeps running.

The old fractions.gcd() gives 32 for them.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22486
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22486] Add math.gcd()

2014-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

I can confirm that it works with 15 bit digits.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22486
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18554] os.__all__ is incomplete

2014-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7230978647a8 by Yury Selivanov in branch 'default':
os: Include posix functions in os.__all__. Closes issue #18554.
https://hg.python.org/cpython/rev/7230978647a8

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18554
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18554] os.__all__ is incomplete

2014-09-26 Thread Yury Selivanov

Yury Selivanov added the comment:

Thanks for the patch.

I've committed this to 3.5 only, as there is a slight chance that it breaks 
backwards compatibility for some scripts.

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18554
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >