[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-03 Thread Yury Selivanov

Yury Selivanov added the comment:

And also right now, inspect.signature looks for '__text_signature__' when no 
used-defined __init__ was found. That's also going to be changed, but again, 
when __text_signature__ becomes a public documented API.

--

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



[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-03 Thread Larry Hastings

Larry Hastings added the comment:

I don't think __text_signature__ should ever be a documented public API.

--

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



[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-03 Thread Yury Selivanov

Yury Selivanov added the comment:

FWIW, I think the same.

--

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



[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-03 Thread Yury Selivanov

Yury Selivanov added the comment:

And also, reading Stefan in another issue, I'm a bit worried that
it may forcibly become a public API. Users tend to start using APIs 
before they are public, and that's especially true for python dunder 
attributes.

Maybe we should document '__text_signature__' and 'sig=', and 
explicitly state that it's a part of CPython private API, that likely 
to have some semantics/syntax changed in 3.5?

--

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



[issue17213] ctypes loads wrong version of C runtime, leading to error message box from system

2014-02-03 Thread Palm Kevin

Palm Kevin added the comment:

+1

--
nosy: +palm.kevin

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



[issue17213] ctypes loads wrong version of C runtime, leading to error message box from system

2014-02-03 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
nosy: +mark.dickinson

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



[issue20485] Enable 'import Non-ASCII.pyd'

2014-02-03 Thread Nick Coghlan

Nick Coghlan added the comment:

Updating the C extension loading API to take advantage of PEP 451 is on the
to do list for 3.5, so I'll see if we can do something about this as well.
However, as Victor noted, it will depend on whether or not we can figure
out a compiler independent cross platform way to look up a non-ASCII symbol
in the extension module's symbol table.

--

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



[issue20489] help() fails for zlib Compress and Decompress objects

2014-02-03 Thread Yury Selivanov

Yury Selivanov added the comment:

The problem is that 'zlib.compressobj().flush.__module__ is None'
Can we fix that in zlib?

--

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



[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-02-03 Thread Larry Hastings

Larry Hastings added the comment:

That buildbot is happy now.  Thanks for pointing it out!

--

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



[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-02-03 Thread Larry Hastings

Larry Hastings added the comment:

 What I'm saying is that the existing function introspection API
 would have provided a much better way to do these things,
 and that it's good to finally have the meta data available in the
 source code so that that API can be made available at some point.

What existing function introspection API?  I wasn't aware there was an 
existing mechanism to provide signature metadata for builtin functions.

--

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



[issue20493] asyncio: OverflowError('timeout is too large')

2014-02-03 Thread Charles-François Natali

Charles-François Natali added the comment:

 Shouldn't this be fixed in the C implementation of the select module or
in selectors.py? It seems likely that the exact range might be different
for each syscall and possibly per OS or even OS version.

Agreed: if we want to fix this, it should be done in the select module.

I'm saying if, because we could either consider such a large timeout as
an error and report it (like it's currently done), or silently cap the
timeout.
The later approach is used by libevent, and makes sense, to a certain
extent (we just need to consider whether this can cause backward
compatibility issues).

--

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



[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-02-03 Thread Stefan Behnel

Stefan Behnel added the comment:

 What existing function introspection API?  I wasn't aware there was an
 existing mechanism to provide signature metadata for builtin functions.

Not for builtin functions, but it's unclear to me why the API of builtin
functions should be different from that of Python functions (except, as I
said, for the existence of byte code).

I agree with Yury, however, that this discussion is unrelated to this ticket.

--

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



[issue17213] ctypes loads wrong version of C runtime, leading to error message box from system

2014-02-03 Thread Palm Kevin

Palm Kevin added the comment:

Reproducible for Py 3.2.5

--
versions: +Python 3.2

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



[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-02-03 Thread Larry Hastings

Larry Hastings added the comment:

 Not for builtin functions, but it's unclear to me why the API of
 builtin functions should be different from that of Python functions
 (except, as I said, for the existence of byte code).

I really don't follow you.  You seem to be saying that __text_signature__ is a 
bad idea, and keep talking about existing
APIs that provide for the same functionality, but you decline to name
specifics.

Be specific.  Let's say we remove __text_signature__.  How do we
now write a C extension in a way that we can have introspection
information for its callables?

If __text_signature__ is redundant with existing APIs, then we should remove it 
now before 3.4 ships.

--

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



[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-02-03 Thread Stefan Behnel

Stefan Behnel added the comment:

Python 3.4.0b3+ (default:19d81cc213d7, Feb  1 2014, 10:38:23)
[GCC 4.8.1] on linux
Type help, copyright, credits or license for more information.
 def test(a,b,c=None): pass
 set(dir(test)) - set(dir(len))
{'__get__', '__code__', '__globals__', '__dict__', '__defaults__', 
'__kwdefaults__', '__annotations__', '__closure__'}
 test.__kwdefaults__
 test.__defaults__
(None,)
 test.__annotations__
{}
 test.__code__
code object test at ..., file stdin, line 1
 dir(test.__code__)
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', 
'__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', 
'__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', 
'__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'co_argcount', 
'co_cellvars', 'co_code', 'co_consts', 'co_filename', 'co_firstlineno', 
'co_flags', 'co_freevars', 'co_kwonlyargcount', 'co_lnotab', 'co_name', 
'co_names', 'co_nlocals', 'co_stacksize', 'co_varnames']
 test.__code__.co_varnames
()
 test.__code__.co_varnames
()
 test.__code__.co_varnames
('a', 'b', 'c')
 test.__code__.co_kwonlyargcount
0
 test.__code__.co_name
'test'


But again, this is not covered by the subject of this ticket. I also don't 
think it's a good idea to delay Py3.4 until this discrepancy is fixed.

--

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



[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-02-03 Thread Stefan Behnel

Stefan Behnel added the comment:


 test.__code__.co_varnames
()
 test.__code__.co_varnames
()
 test.__code__.co_varnames
('a', 'b', 'c')


copypasto, please ignore the first two... :o)

--

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



[issue20368] Tkinter: handle the null character

2014-02-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 But, how many of the replacement sites are exercised by the tests?

I added tests for most the replacement sites and updated tests has even more 
tests.

split() and splitlist() -- tested. Unfortunately they are tested only for bytes 
argument because these methods reject unicode string argument with NUL.

Tcl_Obj.string, Tcl_Obj.typename and Tcl_Obj.__str__() -- not tested. There are 
no explicit tests for these properties and methods. Seems as Tcl_Obj.typename 
can't be tested for NUL.

eval(), evalfile() -- tested.

Variable's methods -- tested.

exprstring() -- tested. I added tests for exprstring(), exprdouble(), 
exprlong(), exprboolean() in the patch.

record() -- not tested. There are no explicit tests for record() and I have no 
ideas how it can be used in Python.

C functions:

FromObj() and Tkapp_CallResult() -- implicitly tested in a lot of tests, in 
particular in test_passing_values and test_user_command.

PythonCmd() -- tested in test_user_command.


 There are a few changes that seem unrelated to nulls, which might have been 
 left for another patch.

They are just make code more robust. For example Tcl can be compiled with 
TCL_UTF_MAX=6. In this case Python will work correctly most time but can work 
incorrectly or crash on specific rare data. With proposed changes it will raise 
SystemError early. Yes, it is worth separate issue.

 Do you know if this code block is tested.

It is implicitly tested in many tests which tests non-ASCII strings.

--
Added file: http://bugs.python.org/file33884/tkinter_null_character_2.patch

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



[issue20479] Efficiently support weight/frequency mappings in the statistics module

2014-02-03 Thread Wolfgang Maier

Wolfgang Maier added the comment:

Well, I was thinking about frequencies (ints) when suggesting

for x,m in data.items():
T = _coerce_types(T, type(x))
n, d = exact_ratio(x)
partials[d] = partials_get(d, 0) + n*m

in my previous message. To support weights (float or Rational) this would have 
to be more sophisticated.

Wolfgang

--

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



[issue20479] Efficiently support weight/frequency mappings in the statistics module

2014-02-03 Thread Oscar Benjamin

Oscar Benjamin added the comment:

 in my previous message. To support weights (float or Rational) this would 
 have to be more sophisticated.

I guess you'd do:

 for x,w in data.items():
 T = _coerce_types(T, type(x))
 xn, xd = exact_ratio(x)
 wn, wd = exact_ratio(w)
 partials[d] = partials_get(xd * wd, 0) + xn * wn

Variance is only slightly trickier. Median would be more complicated.

I just think that I prefer to know when I look at code that something is being
treated as a mapping or as an iterable. So when I look at

d = f(x, y, z)
v = variance_map(d)

It's immediately obvious what d is and how the function variance_map is using
it.

As well as the benefit of readability there's also the fact that accepting
different kinds of input puts strain on any attempt to modify your code in the
future. Auditing the code requires understanding at all times that the name
data is bound to a quantum superposition of different types of object.

Either every function would have to have the same iterable or mapping
interface or there would have to be some other convention for making it clear
which ones do. Perhaps the functions that don't make sense for a mapping could
explicitly reject them rather than treating them as an iterable.

I just think it's simpler to have a different function name for each type of
input. Then it's clear what functions are available for working with mappings.

If you were going for something completely different then you could have an
object-oriented interface where there are classes for the different types of
data and methods that do the right thing in each case.

Then you would do

v = WeightedData(d).variance()

The ordinary variance() function could just become a shortcut for

def variance(data):
return SequenceData(data).variance()

--

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



[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-02-03 Thread Larry Hastings

Larry Hastings added the comment:

Yyou have just answered the question How do you determine signature 
information for functions written in Python?.  A shorter way to express this 
answer: functions written in Python are implemented as a function object (in 
C, PyFunctionObject), which internally has a reference to a code object 
(PyCodeObject).  These two objects collectively contain all the information 
you'd need to determine the function's signature in Python.

However, builtin functions don't use either of these objects.  Builtin 
functions are implemented with a builtin code object (PyCFunctionObject) 
which doesn't have any of the metadata you cited.  So that doesn't answer my 
question.  Nor is it practical to implement a builtin function using a 
function object and a code object.

So I'll ask you again:

 Be specific.  Let's say we remove __text_signature__.  How do we
 now write a C extension in a way that we can have introspection
 information for its callables?

--

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



[issue20498] Update StringIO newline tests

2014-02-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

You forgot to add the patch :)

--

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



[issue20498] Update StringIO newline tests

2014-02-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Indeed. Here is a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file33885/stringio_newline_tests.patch

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



[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-02-03 Thread Stefan Behnel

Stefan Behnel added the comment:

 [...] a builtin code object (PyCFunctionObject) [...] doesn't have any of 
 the metadata you cited.

That exactly is the bug.

I think we should take the further discussion offline, or move it to a new 
ticket.

--

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



[issue20481] Clarify type coercion rules in statistics module

2014-02-03 Thread Oscar Benjamin

Oscar Benjamin added the comment:

It's not as simple as registering with an ABC. You also need to provide the
interface that the ABC represents:

 import sympy
 r = sympy.Rational(1, 2)
 r
1/2
 r.numerator
Traceback (most recent call last):
  File stdin, line 1, in module
AttributeError: 'Half' object has no attribute 'numerator'

AFAIK there are no plans by any third part libraries to increase their
inter-operability with the numeric tower.

My point is that in choosing what types to accept and how to coerce them you
should focus on actual practical benefits rather than theoretical ones. If it
can be done in a way that means it works for more numeric types then that's
great. But when I say works I mean that it should ideally achieve the best
possible accuracy for each type.

If that's not possible then it might be simplest to just document how it works
for combinations of the std lib types (and perhaps subclasses thereof) and
then say that it will fall back on coercing to float for anything else. This
approach is simpler to document and for end-users to understand. It also has
the benefit that it will work for all non std lib types (that I'm aware of)
without pretending to achieve more accuracy than it can.

 import sympy, fractions, gmpy
 fractions.Fraction(sympy.Rational(1, 2))
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python2.7/fractions.py, line 148, in __new__
raise TypeError(argument should be a string 
TypeError: argument should be a string or a Rational instance
 float(sympy.Rational(1, 2))
0.5
 fractions.Fraction(gmpy.mpq(1, 2))
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python2.7/fractions.py, line 148, in __new__
raise TypeError(argument should be a string 
TypeError: argument should be a string or a Rational instance
 float(gmpy.mpq(1, 2))
0.5

Coercion to float via __float__ is well supported in the Python ecosystem.
Consistent support for getting exact integer ratios is (unfortunately) not.

--

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



[issue20405] Add io.BinaryTransformWrapper and a transform parameter to open()

2014-02-03 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 03.02.2014 02:24, STINNER Victor wrote:
 
 STINNER Victor added the comment:
 
 Ever used recode ?
 
 No, what is it? I once used iconv for short tests, but I never required iconv 
 to convert a real document.

It's a command line tool to convert documents in various encodings
to other encodings:

http://recode.progiciels-bpi.ca/index.html
https://github.com/pinard/Recode

It's similar to iconv.

--

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



[issue20405] Add io.BinaryTransformWrapper and a transform parameter to open()

2014-02-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

We already have stackable pieces for gzip, bz2 and lzma compressed streams -- 
GzipFile, BZ2File and LZMAFile. They are more powerful and more efficient than 
generic codecs.StreamReader/codecs.StreamWriter (and note that most binary 
codecs are just don't work correctly with codecs streams).

--

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



[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-02-03 Thread Nick Coghlan

Nick Coghlan added the comment:

Stefan is suggesting that rather than emulating the Python signature line
(which is a concise human readable notation that with the PEP 457 tweaks
will handle even the most obscure custom argument parsing, whether that
parsing is implemented in C or in Python), it would make more sense to
instead emulate the confusing jumble of CPython implementation details
exposed by Python level function and code objects. That ducktyping has been
the traditional way to support signature introspection for anyone that
didn't have the ability to change how the inspect module works.

However, I'm not sure *how* generating and storing an assortment of hard to
interpret lists and strings and mappings would qualify as being simpler
than generating and storing a single string that is only converted into
real signature data if requested. Once __text_signature__ becomes a public
API in 3.5 (as part of PEP 457), inspect shouldn't need to special case any
type ever again: it will be up to the type to set __text_signature__
properly instead.

--

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



[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-02-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I understand Stefan to (reasonably) want 1 api instead of 2. He imagined that 
the only way to do that would be for everything to at least partially imitate 
the old methods. Larry and Nick are suggesting instead that everything should 
adopt the implementation-independent new method. Sounds right to me. So further 
discussion should be about PEP 457, elsewhere.

--

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



[issue20389] clarify meaning of xbar and mu in pvariance/variance of statistics module

2014-02-03 Thread Oscar Benjamin

Oscar Benjamin added the comment:

I agree that the current wording in the doc-strings is ambiguous. It should be 
more careful to distinguish between

mu : true/population mean
xbar : estimated/sample mean

I disagree that the keyword arguments should be made the same. There is an 
important conceptual difference between these two things that the user needs to 
be aware of and mu, xbar - as symbols rather than ascii characters - are widely 
used for this. See e.g. this Wikipedia entry (although it uses ybar instead of 
xbar):
http://en.wikipedia.org/wiki/Variance#Population_variance

--
nosy: +oscarbenjamin

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



[issue20368] Tkinter: handle the null character

2014-02-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

With the additional tests, it seems reasonable to apply.

--

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



[issue20485] Enable 'import Non-ASCII.pyd'

2014-02-03 Thread Suzumizaki

Suzumizaki added the comment:

Thanks for taking into account this issue for PEP 451.

Honestly to say, I can't imagine why or/and how this issue(or my patches) 
causes any problems especially compatibility issues. If someone can point them, 
I will try to resolve.

Note that I extend only the definition of PyInit_. I don't touch the code 
for loading modules.

--

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



[issue20499] Rounding errors with statistics.variance

2014-02-03 Thread Oscar Benjamin

New submission from Oscar Benjamin:

The mean/variance functions in the statistics module don't quite round 
correctly.

The reasons for this are that although exact rational arithmetic is used 
internally in the _sum function it is not used throughout the module. In 
particular the _sum function should be changed to return an exact result and 
exact arithmetic should be used right up to the point before returning to the 
user at which point a rounding/coercion should be used to give the user their 
answer in the appropriate type correctly rounded once.

Using exact arithmetic everywhere makes it possible to replace all of the 
variance* functions with single-pass algorithms based on the computational 
formula for variance which should be more efficient as well.

For example the following implements pvariance so that it returns a perfectly 
rounded result for float input and output in a single pass:

def pvariance(data):
sx = 0
sx2 = 0
for n, x in enumerate(map(Fraction, data), 1):
sx += x
sx2 += x ** 2
Ex = sx / n
Ex2 = sx2 / n
var = Ex2 - Ex ** 2
return float(var)

Comparing the above with the statistics module:

 pvariance([0, 0, 1])
0.
 statistics.pvariance([0, 0, 1])
0.4

The true answer is:

 from fractions import Fraction as F
 float(statistics.pvariance([F(0), F(0), F(1)]))
0.

The logic in the _sum function for computing exact integer ratios and coercing 
back to the output type could be moved into utility functions so that it does 
not need to be duplicated.

Some examples of rounding issues:

 from statistics import variance, mean
 from decimal import Decimal as D, getcontext
 from fractions import Fraction as F

Variance with ints or floats returns a float but the float is not quite the 
nearest possible float:

 variance([0, 0, 2])
1.3335
 float(variance([F(0), F(0), F(2)]))  # true result rounded once
1.

Another example with Decimal:

 getcontext().prec = 5
 getcontext()
Context(prec=5, rounding=ROUND_HALF_EVEN, Emin=-9, Emax=9, 
capitals=1, clamp=0, flags=[Rounded, Inexact], traps=[DivisionByZero, Overflow, 
InvalidOperation])

 variance([D(0), D(0), D(2)] * 2)  # Rounded down instead of up
Decimal('1.0666')
 r = (variance([F(0), F(0), F(2)] * 2))
 D(r.numerator) / r.denominator  # Correctly rounded
Decimal('1.0667')

The mean function may also not be correctly rounded:

 getcontext().prec = 2
 r = mean((F('1.2'), F('1.3'), F('1.55')))
 r
Fraction(27, 20)
 D(r.numerator) / r.denominator # Correctly rounded
Decimal('1.4')
 mean([D('1.2'), D('1.3'), D('1.55')])
Decimal('1.3')

--
components: Library (Lib)
messages: 210121
nosy: oscarbenjamin, stevenjd
priority: normal
severity: normal
status: open
title: Rounding errors with statistics.variance
versions: Python 3.5

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



[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-02-03 Thread Stefan Behnel

Stefan Behnel added the comment:

 I understand Stefan to (reasonably) want 1 api instead of 2.

Absolutely. However, I guess the underlying reasoning here is that there
are other callables, too, so it's not worth making just two kinds of them
look the same, even if both are functions and even if both are part of
CPython itself.

As soon as there is easy-to-use support for annotations in C implemented
functions (for use outside of CPython and Cython), I'll agree that the need
for changing anything in CPython's builtin functions type isn't really
worth bothering about any more in the future, given that the Signature
object is the designated unifying API.

--

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



[issue20500] assertion failed when passing an exception object to sys.exit

2014-02-03 Thread Xavier de Gaye

New submission from Xavier de Gaye:

The following code crashes python with:

python: Objects/object.c:512: PyObject_Str: Assertion `!PyErr_Occurred()' 
failed.

on the tip of the default branch, but not on python 3.3.3.


import sys

error = None
try:
raise ValueError('some text')
except ValueError as err:
error = err

if error:
sys.exit(error)

--
components: Interpreter Core
messages: 210123
nosy: xdegaye
priority: normal
severity: normal
status: open
title: assertion failed when passing an exception object to sys.exit
type: crash
versions: Python 3.4, Python 3.5

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



[issue20485] Enable 'import Non-ASCII.pyd'

2014-02-03 Thread Nick Coghlan

Nick Coghlan added the comment:

As Victor noted, inventing our own encoding scheme just for this use case
isn't desirable, although it's certainly a good fallback option that will
ensure the feature remains feasible even if trying to handle the Unicode
issues at the C compiler level proves too challenging.

The other aspect is that changes to the extension module initialisation API
always need to go into a PEP regardless, since we need to ensure such
changes are usable for both handwritten extensions and extension module
generators like Cython, cffi and SWIG.

--

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



[issue20485] Enable 'import Non-ASCII.pyd'

2014-02-03 Thread STINNER Victor

STINNER Victor added the comment:

Oh, the topic was already discussed some years ago. Start:
https://mail.python.org/pipermail/python-dev/2011-May/111279.html

--

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



[issue20500] assertion failed when passing an exception object to sys.exit

2014-02-03 Thread R. David Murray

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


--
nosy: +haypo, larry
priority: normal - release blocker
stage:  - needs patch
versions:  -Python 3.5

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



[issue20481] Clarify type coercion rules in statistics module

2014-02-03 Thread Wolfgang Maier

Wolfgang Maier added the comment:

 there are currently two strict requirements for any numeric type to be usable 
 with statistics._sum:

I meant *three* of course (remembered one only during writing).

--

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



[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-03 Thread Larry Hastings

Larry Hastings added the comment:

  Also also, I remember specifically that the isinstance(type) code
  would fail builtin classes.

 Could you please find an example of this?

This was during the development of the original feature.  I changed the if 
statement for the from_builtin() call so it'd accept type objects too.  But it 
never got a chance to see any, because the check for type objects above it 
would see that it was a type, see that it was a builtin type, and raise an 
exception.  That's why I moved the if statement with the from_builtin() call to 
the top of the function, so it would get the first chance to examine the 
callable.

This was just historical context, and I'm sure you already solved the problem 
in an equivalent way.

--

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



[issue20481] Clarify type coercion rules in statistics module

2014-02-03 Thread Wolfgang Maier

Wolfgang Maier added the comment:

Just to make sure that this discussion is not getting on the wrong track,
there are currently two strict requirements for any numeric type to be usable 
with statistics._sum:

(1) the type has to provide either
- numerator/denominator properties or
- an as_integer_ratio method or
- an as_tuple method that mimicks the Decimal method of that name

this requirement comes from statistics._exact_ratio.

This is where, for example, the sympy numeric types fail because they do not 
provide any of these interfaces.



For completeness, this is the code of this function:

def _exact_ratio(x):
Convert Real number x exactly to (numerator, denominator) pair.

 _exact_ratio(0.25)
(1, 4)

x is expected to be an int, Fraction, Decimal or float.

try:
try:
# int, Fraction
return (x.numerator, x.denominator)
except AttributeError:
# float
try:
return x.as_integer_ratio()
except AttributeError:
# Decimal
try:
return _decimal_to_ratio(x)
except AttributeError:
msg = can't convert type '{}' to numerator/denominator
raise TypeError(msg.format(type(x).__name__)) from None
except (OverflowError, ValueError):
# INF or NAN
if __debug__:
# Decimal signalling NANs cannot be converted to float :-(
if isinstance(x, Decimal):
assert not x.is_finite()
else:
assert not math.isfinite(x)
return (x, None)

*

(2) Essentially, the numerator and the denominator returned by _exact_ratio 
have to be valid arguments for the Fraction constructor.
This is a consequence of this block of code in _sum:

for d, n in sorted(partials.items()):
total += Fraction(n, d)

Of note, Fraction(n, d) requires both arguments to be members of 
numbers.Rational and this is where, for example, the gmpy.mpq type fails.

(3) The type's constructor has to work with a Fraction argument.
This is because _sum tries to

return T(total) # where T is the coerced type and total the calculated sum 
as a Fraction
The gmpy.mpq type, for example, fails at this step again.


ACTUALLY: THIS SHOULD BE RAISED AS ITS OWN ISSUE HERE as soon as the coercion 
part is settled because it means that _sum may succeed with certain mixed input 
types even though some of the same types may fail, when they are the only type.


IMPORTANTLY, neither requirement has anything to do with the module's type 
coercion, which is the topic of this discussion.

IN ADDITION, the proposed patch involving _coerce_types adds the following 
(soft) requirement:
in order to be able to coerce a sequence of numbers of mixed numeric types 
without loss of precision all involved types need to be integrated into the 
hierarchy of numeric abstract base classes as defined in the numbers module 
(otherwise all types are coerced to float).

From this it should be clear that the compatibility bottleneck is not in this 
patch, but in other parts of the module.

What is more, if a custom numeric type implements the numerator/denominator 
properties, then it is simple enough to register it as a virtual subclass of 
numbers.Rational or .Integral to enable lossless coercion in the presence of 
mixed types.

Example with gmpy2 numeric type:

 from gmpy2 import mpq # mpq is gmpy's Fraction equivalent
 import numbers

 numbers.Rational.register(type(mpq()))
 r = mpq(7,5)
 type(r)
class 'mpq'

 issubclass(type(r), numbers.Rational)
True

= the mpq type could now be coerced correctly even in mixed input types 
situations, but remains incompatible with _sum for reasons (2) and (3).


SUMMARY: Making _sum work with custom types is very complicated, BUT:
this is not due to type coercion as it is discussed here.

--

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



[issue16074] Bad error message in os.rename, os.link, and os.symlink

2014-02-03 Thread Larry Hastings

Larry Hastings added the comment:

As release manager, I would be willing to consider this patch.  However, as 
original author of the code in question, I don't like it.  Showing zero 
filenames, while potentially less confusing, is also far less helpful.  A 
better solution would be to show both filenames.  This would require changing 
the OSError exception, and adding some new PyErr_ API calls.  I'm now working 
on a patch to do that.

--

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



[issue20501] fileinput module will read whole file into memory when using fileinput.hook_encoded

2014-02-03 Thread Gunnar Aastrand Grimnes

New submission from Gunnar Aastrand Grimnes:

When reading large files with fileinput, it will work as expected and only 
process a line at a time when used normally, but if you add an hook_encoded 
openhook it will read the whole file into memory before returning the first 
line. 

Verify by running this program on a large text file: 

import fileinput

for l in fileinput.input(openhook=fileinput.hook_encoded('iso-8859-1')):
raw_input()

and check how much memory it uses. Remove the openhook and memory usage goes 
down to nothing.

--
components: IO
messages: 210130
nosy: gromgull
priority: normal
severity: normal
status: open
title: fileinput module will read whole file into memory when using 
fileinput.hook_encoded
type: behavior
versions: Python 2.7

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



[issue20502] Context.create_decimal_from_float() inconsistent precision for zeros after decimal mark

2014-02-03 Thread Mauricio de Alencar

New submission from Mauricio de Alencar:

The following code demonstrates an inconsistency of this method in dealing with 
zeros after the decimal mark.


from decimal import Context

context = Context(prec=2)

for x in [100., 10., 1., 0.1]:
print(context.create_decimal_from_float(x), 
context.create_decimal_from_float(4.56*x))


Produces the output:
1.0E+2 4.6E+2
10 46
1 4.6
0.10 0.46

Line 3 is inconsistent. It should be 1.0 4.6.

--
messages: 210131
nosy: mdealencar
priority: normal
severity: normal
status: open
title: Context.create_decimal_from_float() inconsistent precision for zeros 
after decimal mark
type: behavior
versions: Python 3.3

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



[issue20384] os.open() exception doesn't contain file name on Windows

2014-02-03 Thread Larry Hastings

Larry Hastings added the comment:

If it's fixed in 3.4, then the first step would be to ask Georg if he will 
accept a fix for 3.3.  If he will not, then we don't need to go any further.

--

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



[issue20501] fileinput module will read whole file into memory when using fileinput.hook_encoded

2014-02-03 Thread Gunnar Aastrand Grimnes

Gunnar Aastrand Grimnes added the comment:

The problem lies in codecs.py here: 
http://hg.python.org/cpython/file/ae7facd874ba/Lib/codecs.py#l581

--

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



[issue20384] os.open() exception doesn't contain file name on Windows

2014-02-03 Thread Mark Lawrence

Mark Lawrence added the comment:

Good afternoon,

Would you please be kind enough to have my name removed from all nosy lists as 
I've no interest in being constantly reminded that I've been called a liar.

Kindest regards. 

Mark Lawrence.

On Monday, 3 February 2014, 14:46, Larry Hastings rep...@bugs.python.org 
wrote:

Larry Hastings added the comment:

If it's fixed in 3.4, then the first step would be to ask Georg if he will 
accept a fix for 3.3.  If he will not, then we don't need to go any further.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20384
___



--

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



[issue20481] Clarify type coercion rules in statistics module

2014-02-03 Thread Oscar Benjamin

Oscar Benjamin added the comment:

I agree that supporting non-stdlib types is in some ways a separate issue from
how to manage coercion with mixed stdlib types. Can you provide a complete
patch (e.g. hg diff  coerce_types.patch).
http://docs.python.org/devguide/

There should probably also be tests added for situations where the current
implementation behaves undesirably. Something like these ones:
http://hg.python.org/cpython/file/a97ce3ecc96a/Lib/test/test_statistics.py#l1445

Note that when I said non-stdlib types can be handled by coercing to float I
didn't mean that the output should be coerced to float but rather the input
should be coerced to float because __float__ is the most consistent interface
available on third party numeric types.

Once the input numbers are converted to float statistics._sum can handle them
perfectly well. In this case I think the output should also be a float so that
it's clear that precision may have been lost. If the precision of float is not
what the user wants then the documentation can point them toward
Fraction/Decimal.

--

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



[issue14911] generator.throw() documentation inaccurate

2014-02-03 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

Here's one for 2.7.  I'm still looking at 3.  The funny thing is that the 
signature of generator.throw reflects 2.x conventions.  I'm figuring out if it 
can be used with the .with_traceback() idiom

--
keywords: +patch
Added file: http://bugs.python.org/file33886/throw27.diff

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



[issue20384] os.open() exception doesn't contain file name on Windows

2014-02-03 Thread Larry Hastings

Larry Hastings added the comment:

Mark Lawrence: you can remove it yourself, by directly editing the nosy list 
on the page for the bug.  If you want to remove yourself from all issues on the 
tracker, click on the Followed by you link on the left side and work your way 
down the list.

--

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



[issue20489] help() fails for zlib Compress and Decompress objects

2014-02-03 Thread Larry Hastings

Larry Hastings added the comment:

Nope, we can't fix it in zlib.  As far as I can tell, the problem is that 
method_get() in descrobject.c passes in NULL for the module to 
PyCFunction_NewEx().  method_get gets the type as part of the descriptor 
protocol, but type objects in C don't appear to have a module pointer.  Module 
objects in Python do seem to, so maybe we can get it from somewhere?

If we can't fix this, we'll have to go back to expressly writing the name of 
the module in the expression (zlib.Z_FINISH).  I assume changing the 
expression to use Z_FINISH (etc) makes it work again?

I'm calling in Nick, maybe he'll know what to do.

Nick: default values in text signatures allow simple expressions. 
inspect.Signature looks up the values of constant-ish things like 
sys.maxsize.  It allows you to name constants from the local module without 
the module name first; it gets the module using the __module__ attribute on the 
callable.

--
nosy: +ncoghlan

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



[issue20384] os.open() exception doesn't contain file name on Windows

2014-02-03 Thread Mark Lawrence

Mark Lawrence added the comment:

@Larry - thank you for the heads up.

--

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



[issue7325] tempfile.mkdtemp() does not return absolute pathname when relative dir is specified

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue7776] http.client.HTTPConnection tunneling is broken

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue20384] os.open() exception doesn't contain file name on Windows

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue1353344] python.desktop

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue19145] Inconsistent behaviour in itertools.repeat when using negative times

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue7262] codecs.open() + eol (windows)

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue20399] Comparison of memoryview

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue1776674] glob.glob inconsistent

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue20047] bytearray partition bug

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue20467] Confusing wording about __init__

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue4492] httplib code thinks it closes connection, but does not

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue15027] Faster UTF-32 encoding

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -Arfrever

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



[issue20266] Bring Doc/faq/windows up to date

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue2943] Distutils should generate a better error message when the SDK is not installed

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue20335] bytes constructor accepts more than one argument even if the first one is not a string

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue19548] 'codecs' module docs improvements

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue6128] Consequences of using Py_TPFLAGS_HAVE_GC are incompletely explained

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue19980] Improve help('non-topic') response

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-02-03 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here is the updated patch addressing Zachary's reviews (Thanks!). However, 
there are some reviews that I could not implement.

1. This is a good candidate for a custom return converter.

I can not synchronize struct rlimit and NULL return values.

2. Should be 'class float PyFloatObject * PyFloat_Type'.  Using 
PyFloatObject
* instead of PyObject * may require some casts to PyObject * in some places, but
it's better to use the real name.

I tried it but it was like opening pandora box. It's too much effort to 
surpress compile errors and warnings. And casting PyFloatObject to PyObject in 
many places, such as functions, macros, makes me nervous. I think this one 
deserves a dedicated ticket.

--
Added file: http://bugs.python.org/file33887/issue20185_conglomerate_v2.diff

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



[issue2175] Expat sax parser silently ignores the InputSource protocol

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue777588] asyncore is broken for windows if connection is refused

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue19104] pprint produces invalid output for long strings

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue504219] locale.resetlocale is broken

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue7105] weak dict iterators are fragile because of unpredictable GC runs

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue4945] json checks True/False by identity, not boolean value

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue6501] Fatal error on startup with invalid PYTHONIOENCODING

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue8075] Windows (Vista/7) install error when choosing to compile .py files

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue14910] argparse: disable abbreviation

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue4037] doctest.py should include method descriptors when looking inside a class __dict__

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue3802] smtpd.py __getaddr insufficient handling

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue19655] Replace the ASDL parser carried with CPython

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue1208730] expat binding for XML_ParserReset

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue4727] copyreg doesn't support keyword only arguments in __new__

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue2213] build_tkinter.py does not handle paths with spaces

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue1098749] Single-line option to pygettext.py

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue2889] curses for windows (alternative patch)

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue20481] Clarify type coercion rules in statistics module

2014-02-03 Thread Wolfgang Maier

Wolfgang Maier added the comment:

 Once the input numbers are converted to float statistics._sum can handle
 them perfectly well. In this case I think the output should also be a float so
 that it's clear that precision may have been lost. If the precision of float 
 is not
 what the user wants then the documentation can point them toward
 Fraction/Decimal.

Ah, I'm getting it now. That is actually a very interesting thought. Still I 
don't think this should be part of this issue discussion, but I'll think about 
it and file a new enhancement issue if I have an idea.


As for providing the complete patch, I can do that I guess, but formulating the 
tests may take a while. I'll try to do it though, if Steven thinks it's worth 
it. After all he's the one who'd have to approve it and the patch does alter 
his design quite a bit.

--

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



[issue7442] _localemodule.c: str2uni() with different LC_NUMERIC and LC_CTYPE

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue6159] Tkinter.PanedWindow: docstring fixes, change in paneconfigure and removed some returns

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue1763] Get path to shell/known folders on Windows

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue6225] Fixing several minor bugs in Tkinter.Canvas and one in Misc._configure

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue6181] Tkinter.Listbox several minor issues

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue20501] fileinput module will read whole file into memory when using fileinput.hook_encoded

2014-02-03 Thread R. David Murray

R. David Murray added the comment:

This requires (1) a doc update to indicate the problem and (2) a way to tell 
fileinput to *not* use readlines to optimize by calling readlines(bufsize), 
since in the case of using codecs it can be a problem.  Presumably buffer=None 
would be the logical way to spell this.
I'm marking this as a doc bug, a separate issue should be opened for adding the 
fileinput buffer=None enhancement.

(The codec module's comments indicate there's no practical way to implement 
sizehint.)

--
assignee:  - docs@python
components: +Documentation
nosy: +docs@python, r.david.murray
versions: +Python 3.3, Python 3.4

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



[issue4350] Remove dead code from Tkinter.py

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue6335] Add support for mingw

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue16037] httplib: header parsing is unlimited

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue7757] sys.path is incorrect when prefix is

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue1887] distutils doesn't support out-of-source builds

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



  1   2   3   4   >