Ezio Melotti ezio.melo...@gmail.com added the comment:
From Ezio's original post: '''
If a function has optional arguments but it doesn't accept keyword
arguments, the func([arg1]) notation is used instead. ... The
notation func([arg=default]) should never be used, and func([arg])
should
Ezio Melotti ezio.melo...@gmail.com added the comment:
I found safe_repr() from Lib/unittest/util.py.
The functions in Lib/unittest/util.py shouldn't be used outside unittest.
We would require a similar function, just implemented in C.
What is a good place to define such C helpers that
Petri Lehtinen pe...@digip.org added the comment:
Ezio Melotti wrote:
You could start by adding it in the file where you need it. If it
starts becoming useful elsewhere too, it can then be moved somewhere
else. I would expect such function to be private, so we are free to
move it whenever we
New submission from Chase Albert thaoe...@gmail.com:
My expectation was that range(2,5) == range(2,5), and that they should hash the
same. This is not the case.
--
messages: 147838
nosy: rob.anyone
priority: normal
severity: normal
status: open
title: Ranges cannot be meaningfully
Florent Xicluna florent.xicl...@gmail.com added the comment:
this was implemented with ticket #13201.
It will be available in version 3.3.
--
nosy: +flox
resolution: - out of date
stage: - committed/rejected
status: open - closed
superseder: - Implement comparison operators for range
New submission from Éric Araujo mer...@netwok.org:
The new opener argument to open and TextIOWrapper closed two bugs on this
tracker: using O_CLOEXEC and replacing the unofficial 'c' mode (O_CREATE). I
think it’d be nice to have these as examples (maybe not in the docs of
TextIOWrapper which
Éric Araujo mer...@netwok.org added the comment:
See #13424 for a doc request about this.
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12760
___
Éric Araujo mer...@netwok.org added the comment:
s/TextIOWrapper/FileIO/
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13424
___
___
Éric Araujo mer...@netwok.org added the comment:
See #13424 for a doc request about this.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12797
___
Éric Araujo mer...@netwok.org added the comment:
Seems reasonable to me. When did/does unicodedata ever have a __file__
attribute?
No idea. Maybe it has to do with static vs. dynamic linking? Or alternate VMs?
--
___
Python tracker
Éric Araujo mer...@netwok.org added the comment:
Looks good.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2979
___
___
Python-bugs-list
Ezio Melotti ezio.melo...@gmail.com added the comment:
Attached patch should solve the issue.
--
assignee: - ezio.melotti
keywords: +patch
stage: test needed - commit review
versions: +Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23721/issue13358.diff
Éric Araujo mer...@netwok.org added the comment:
Hi Michele, long time no see :)
Well, actually SimpleHTTPRequesthandler extends BaseHTTPHandler with basic
do_GET and
do_HEAD methods.
Unittests for http.server shows that this behavior is intended, since: [snip]
Not sure what this test
Ezio Melotti ezio.melo...@gmail.com added the comment:
I did some tests, creating an element ('elem') that contains two adjacent text
nodes ('text'). With my latest patch the prettyprint is:
?xml version=1.0 ?
elem
text
text
/elem
Here both the text nodes are printed on a
New submission from Stanisław Jankowski stach.jankow...@gmail.com:
http.client.HTTPMessage.getallmatchingheaders() always returns []
Python 3.2.2:
Calling the code below does not give the expected result.
sjankowski@sjankowski:~$ python3
Python 3.2.2rc1 (default, Aug 14 2011, 18:43:44)
[GCC
Ezio Melotti ezio.melo...@gmail.com added the comment:
The problem seems to be in Lib/http/client.py:227.
The code adds a ':' that is not found in the list of headers returned by
self.keys().
--
nosy: +ezio.melotti
___
Python tracker
Changes by Petri Lehtinen pe...@digip.org:
--
nosy: +petri.lehtinen
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13425
___
___
Python-bugs-list
New submission from Nebelhom nebel...@googlemail.com:
--
Python v3.3a0 documentation The Python Standard Library 11. Data
Persistence
Section 11.1 pickle module
#1
11.1.3. Module Interface
exception pickle.UnpicklingError
Error raised when there a problem
Ezio Melotti ezio.melo...@gmail.com added the comment:
Actually the headers are already parsed, so the code should use self.items()
instead of self.keys(), check if the key (without ':') matches, and append the
key-value pair to the list.
Having a list of key-value pairs seems more useful than
Nick Coghlan ncogh...@gmail.com added the comment:
Please don't stress too much about providing an indication that the repr has
been truncated - it's an error message, not part of the normal program output.
Besides, the lack of a closing ')', ']', '}' or '' will usually indicate
something is
New submission from Alan Beccati alan.becc...@gmail.com:
Hello,
did I discover a python string comparison bug or is this behaviour expected and
I am doing something wrong?
This is the code I run:
for line in lines[4:]:
currColl=line.split(:)[1].strip()
print
Florent Xicluna florent.xicl...@gmail.com added the comment:
collName is probably not what you expect.
You can print repr(collName), repr(currColl) to verify this.
It is not a bug on Python side.
--
nosy: +flox
resolution: - works for me
stage: - committed/rejected
status: open -
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset ce34e9223450 by Ezio Melotti in branch '2.7':
#13426: fix typo in pickle doc.
http://hg.python.org/cpython/rev/ce34e9223450
New changeset 1f31061afdaf by Ezio Melotti in branch '3.2':
#13426: fix typos in pickle
Ezio Melotti ezio.melo...@gmail.com added the comment:
This is fixed now, thanks for the report!
Regarding #4, sqlite3 is included in the official installer provided for
Windows, so that shouldn't be a problem.
Regarding the output, I don't think is necessary to add it.
The example is fairly
New submission from Petri Lehtinen pe...@digip.org:
Currently, the width and precision information for string codes are accepted
but ignored. They should be used to pad short strings (width) and truncate long
ones (precision), just like printf() (only in terms of code points rather than
Petri Lehtinen pe...@digip.org added the comment:
Nick Coghlan wrote:
Please don't stress too much about providing an indication that the
repr has been truncated - it's an error message, not part of the
normal program output. Besides, the lack of a closing ')', ']', '}'
or '' will usually
STINNER Victor victor.stin...@haypocalc.com added the comment:
Duplicate of #7330.
--
nosy: +haypo
resolution: - duplicate
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13428
STINNER Victor victor.stin...@haypocalc.com added the comment:
Issue #13428 has been marked as a duplicate of this issue.
--
nosy: +petri.lehtinen
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7330
Changes by Florent Xicluna florent.xicl...@gmail.com:
--
status: pending - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13427
___
___
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
title: The Python Standard Library 11. Data Persistence - Typos in pickle
docs
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13426
Nebelhom nebel...@googlemail.com added the comment:
Hi Ezio,
Regarding the output, I don't think is necessary to add it.
I left it in because of a discussion in core-mentorship, where they
mentioned that it would be beneficial to have it in. I pasted the exchange
below if you are interested.
Ezio Melotti ezio.melo...@gmail.com added the comment:
Here is a new patch.
--
Added file: http://bugs.python.org/file23722/issue6570-2.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6570
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13125
___
___
Python-bugs-list
Éric Araujo mer...@netwok.org added the comment:
Looks good to me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10772
___
___
Python-bugs-list
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
stage: patch review - commit review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10772
___
___
Éric Araujo mer...@netwok.org added the comment:
Ok, I found a similar problem with MMTK.
I don’t know what that is.
I am currently altering my distutils package to add a function called
nt_quote_dir
that adds quotes to paths with spaces and then applies it to each path if the
platform
Michele Orrù maker...@gmail.com added the comment:
These tests shows how SimpleHTTPRequestHandler behaves: if the class
contains a do_FOO method, it is called, otherwise error501 is raised.
That's what Karl said with «Or to modify the library code that for any
resources not yet defined.».
Since
Alan alan.becc...@gmail.com added the comment:
Using repr highlights the issue which lies in the behaviour of str.strip()
which does not strip away null spaces as I would have expected:
' 'utm10\x00' ' == ' 'utm10' '
not equal
Changing the code to:
currColl=line.split(:)[1].strip().strip(\0)
Éric Araujo mer...@netwok.org added the comment:
Hi David. Thanks for reporting the issue. I have to warn you that there is a
high bar for distutils changes; due to the mass of code out there that relies
on undocumented internal behavior or works around old bugs, a feature freeze is
in
Ezio Melotti ezio.melo...@gmail.com added the comment:
Nope, str.strip only strips whitespace, and \x00 is not considered whitespace:
'\x00'.isspace()
False
--
nosy: +ezio.melotti
resolution: works for me - invalid
___
Python tracker
Michele Orrù maker...@gmail.com added the comment:
As Ezio just pointed out, strip('\r\n') is still behaves differently from the
previous code. Sorry for that.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13294
David Amian dam...@emergya.com added the comment:
sorry, I didn't explain well.
I've a project, in the setup.py file, I've a function called update_prefix,
that updates the 'path_project' variable with prefix arguments from setup.py
If you runs setup.py with --prefix=/usr, then the file in
Éric Araujo mer...@netwok.org added the comment:
Regarding the output, I don't think is necessary to add it.
I left it in because of a discussion in core-mentorship, where they
mentioned that it would be beneficial to have it in.
Well, people can have diverging opinions. Terry’s was that
Changes by Ross Lagerwall rosslagerw...@gmail.com:
--
nosy: +rosslagerwall
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13424
___
___
Éric Araujo mer...@netwok.org added the comment:
I worked on this a bit more and the current boring diff has more than 1000
deleted lines and more than 1000 added lines. After thinking about it, maybe I
should not make a mega-patch with markup/boring changes first but rather fix
markup as
Éric Araujo mer...@netwok.org added the comment:
I've a project, in the setup.py file, I've a function called update_prefix,
that updates the
'path_project' variable with prefix arguments from setup.py
If you runs setup.py with --prefix=/usr, then the file in
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4442
___
___
Python-bugs-list
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4395
___
___
Python-bugs-list
sbt shibt...@gmail.com added the comment:
Thanks again. Just a nit: the tests should be in MiscIOTest, since
they don't directly instantiate the individual classes. Also, perhaps
it would be nice to check that the exception's errno attribute is
EAGAIN.
Done.
--
Added file:
Éric Araujo mer...@netwok.org added the comment:
The commit details (including its changeset, branch and commit message)
In Mercurial terminology, a changeset *is* a commit (or if you really want to
make a distinction, a commit is the action that creates a changeset). I think
you meant
Éric Araujo mer...@netwok.org added the comment:
It's made my day. I get to boast at school now!
You could do more of that if you got a patch committed! See
http://docs.python.org/devguide and
http://mail.python.org/mailman/listinfo/core-mentorship for more info if you’re
interested.
Éric Araujo mer...@netwok.org added the comment:
Thanks for cleaning up the reports. I’m not a numbers person :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13292
___
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 7262f8f276ff by Ezio Melotti in branch '2.7':
#4147: minidom's toprettyxml no longer adds whitespace around a text node when
it is the only child of an element. Initial patch by Dan Kenigsberg.
Ezio Melotti ezio.melo...@gmail.com added the comment:
I committed my patch with a few more tests. This should be fixed now.
Thanks for the report and the patch!
--
resolution: - fixed
stage: commit review - committed/rejected
status: open - closed
New submission from Stefan Behnel sco...@users.sourceforge.net:
In Python modules, the top-level module code sees the __file__ variable and can
use it to refer to resources in package subdirectories, for example. This is
not currently possible in extension modules, because __file__ is only set
New submission from Marko Nervo ma...@python.it:
I think it would be very usefull to add a curry function to the functools
module. It should be like this.
def curry(func, *args, **kwargs):
if (len(args) + len(kwargs)) = func.__code__.co_argcount:
return func(*args, **kwargs)
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 91163aa3d5b4 by Ezio Melotti in branch '2.7':
#13358: HTMLParser now calls handle_data only once for each CDATA.
http://hg.python.org/cpython/rev/91163aa3d5b4
New changeset 0a32e7e3aa1f by Ezio Melotti in branch
Ezio Melotti ezio.melo...@gmail.com added the comment:
This should be fixed now, let me know if you find other problems with the
parser.
--
resolution: - fixed
stage: commit review - committed/rejected
status: open - closed
___
Python tracker
Ezio Melotti ezio.melo...@gmail.com added the comment:
This sounds similar to
http://wiki.python.org/moin/PythonDecoratorLibrary#Pseudo-currying
Do you have a concrete use case for this?
--
nosy: +ezio.melotti
versions: +Python 3.3 -Python 2.7, Python 3.4
Antoine Pitrou pit...@free.fr added the comment:
You can use functools.partial for similar effect. Not sure what a dedicated
curry() primitive would improve.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
Alex Gaynor alex.gay...@gmail.com added the comment:
This already exists, as functools.partial:
http://docs.python.org/library/functools.html#functools.partial
--
nosy: +alex
resolution: - invalid
status: open - closed
___
Python tracker
Changes by Stefan Behnel sco...@users.sourceforge.net:
--
keywords: +patch
nosy: +loewis
Added file: http://bugs.python.org/file23725/ext_module_init_file_path.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13429
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +brian.curtin
stage: - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9614
___
Stefan Behnel sco...@users.sourceforge.net added the comment:
Here is an extension to the patch that implements the protocol also for
extension module reinitialisation, so that the module creation can also set
__file__ and the proper package in that case. Currently without tests (and
users, I
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
resolution: accepted -
versions: +Python 3.3 -Python 2.6, Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3430
Sébastien Sablé sa...@users.sourceforge.net added the comment:
I can also confirm that this patch corrects the problem with test_asyncore for
Python 2.7 built with VS2010.
--
nosy: +sable
___
Python tracker rep...@bugs.python.org
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 0fdf7f7c353d by Ezio Melotti in branch '2.7':
#2: Fix typo in a base class in test_socket.
http://hg.python.org/cpython/rev/0fdf7f7c353d
New changeset b410bcd300a1 by Ezio Melotti in branch '3.2':
#2: Fix
Brian Curtin br...@python.org added the comment:
FYI: this would likely be handled through #13210. I have a conversion sandbox
started at http://hg.python.org/sandbox/vs2010port/ and am working through
fixing test failures after the initial conversion.
--
Ezio Melotti ezio.melo...@gmail.com added the comment:
Fixed, thanks for the report!
--
assignee: - ezio.melotti
nosy: +ezio.melotti
resolution: - fixed
stage: needs patch - committed/rejected
status: open - closed
versions: -Python 3.1
___
Python
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
stage: - needs patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11107
___
___
Brian Curtin br...@python.org added the comment:
I mentioned this on another issue, but I created a clone at
http://hg.python.org/sandbox/vs2010port/. I've already gone through the port in
the past but wasn't able to release the code at the time. As I work through it,
I'll occasionally
Tim Golden m...@timgolden.me.uk added the comment:
Thanks. I was going to ask about this to see if anyone had already done
the legwork.
--
nosy: +tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13210
Ezio Melotti ezio.melo...@gmail.com added the comment:
Now it's too late for 3.1, should this still go to 2.7?
--
nosy: +ezio.melotti
versions: -Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10980
Benjamin Peterson benja...@python.org added the comment:
Please.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10980
___
___
Python-bugs-list
Marko Nervo ma...@python.it added the comment:
In [1]: import functools
In [2]: def adder(x, y, z):
...: return (x + y + z)
...:
In [3]: adder = functools.partial(adder)
In [4]: adder(2)(3)(4)
---
TypeError
Ezio Melotti ezio.melo...@gmail.com added the comment:
Fixed.
--
assignee: docs@python - ezio.melotti
resolution: - fixed
stage: needs patch - committed/rejected
status: open - closed
versions: +Python 2.7, Python 3.2
___
Python tracker
Éric Araujo mer...@netwok.org added the comment:
To go back to your original message:
I think it would be very usefull to add a curry function to the functools
module.
For what use cases?
Curried functions could be used as follow.
adder(2, 3, 4)
adder(2, 3)(4)
adder(2)(3)(4)
adder(z =
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset fd9d7a8e45bc by Ezio Melotti in branch '2.7':
#13387: add note about checking the exact type in assertIsInstance doc.
http://hg.python.org/cpython/rev/fd9d7a8e45bc
New changeset 583aff635ce1 by Ezio Melotti in
Sébastien Sablé sa...@users.sourceforge.net added the comment:
I had the exact same problem when compiling the Python 2.7 branch with Visual
Studio 2010.
In debug mode and 64 bits, python will crash on test_loads_recursion in
test_marshal and on the code provided in msg63536.
Could you
Stefan Behnel sco...@users.sourceforge.net added the comment:
Updated single slice caching patch for latest Py3.3 hg tip.
--
Added file: http://bugs.python.org/file23727/slice-object-cache.patch
___
Python tracker rep...@bugs.python.org
Éric Araujo mer...@netwok.org added the comment:
+ To check for a specific type (without including superclasses) use
+ :func:`assertIs(type(obj), cls) assertIs`.
Don’t you mean “without accepting subclasses”, not superclasses?
--
___
Python tracker
Ezio Melotti ezio.melo...@gmail.com added the comment:
FWIW there is a somewhat related thread that proposed a new syntax for curried
functions: http://mail.python.org/pipermail/python-ideas/2009-March/003220.html
--
stage: - committed/rejected
___
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
I suppose that the value of _Py_ModuleImportContext is protected by the import
lock?
--
nosy: +amaury.forgeotdarc
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13429
Ezio Melotti ezio.melo...@gmail.com added the comment:
+ To check for a specific type (without including superclasses) use
+ :func:`assertIs(type(obj), cls) assertIs`.
Don’t you mean “without accepting subclasses”, not superclasses?
I mean:
class MyInt(int): pass # my specific type
...
Armin Ronacher armin.ronac...@active-4.com added the comment:
2.7 does not suffer from this since 2.7 does not support unicode in headers.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10980
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13404
___
___
Python-bugs-list
Sébastien Sablé sa...@users.sourceforge.net added the comment:
I don't have the issue anymore when bumping the stack size to 230.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2286
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13397
___
___
Python-bugs-list
Changes by Brian Curtin br...@python.org:
--
components: +Windows
nosy: +brian.curtin
status: closed - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2286
___
Stefan Behnel sco...@users.sourceforge.net added the comment:
I don't know how the import lock applies here. Would it have to be protected by
it? The lifetime is restricted to the call of the extension module init
function, and its value is saved recursively if the init function triggers
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
But the GIL can be released in many places (e.g. a Py_DECREF), and another
thread can enter the same function and update the same static variable.
--
___
Python tracker
Marko Nervo ma...@python.it added the comment:
I totally disagree with the syntax for curried function, but I think a curry
function is perfect for the functools module and I also think it could be
useful at least as functools.partial. In addition, a lot of languages support
currying, such as
Antoine Pitrou pit...@free.fr added the comment:
However, here an example less confusional
adder = curry(lambda (x, y): (x + y))
adder3 = adder(3)
adder3(4)
7
adder3(5)
8
Currying let you defining new functions on other functions.
But so does functools.partial. So the question
Ezio Melotti ezio.melo...@gmail.com added the comment:
In that thread Guido said:
Haskell has this too, perhaps even more extreme: there's not really
such a thing in Haskell as a function of N arguments (N 1). f a b =
... defines a function f of one argument a which returns another
function (f
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset fa2f8dd077e0 by Antoine Pitrou in branch 'default':
Issue #10227: Add an allocation cache for a single slice object.
http://hg.python.org/cpython/rev/fa2f8dd077e0
--
nosy: +python-dev
Antoine Pitrou pit...@free.fr added the comment:
Thanks Stefan. I'm leaving the issue open since the original topic is a bit
different.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10227
Antoine Pitrou pit...@free.fr added the comment:
Thanks. Who should I credit? sbt?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13322
___
___
Antoine Pitrou pit...@free.fr added the comment:
This issue is obsolete, there are no 64-bit warnings in _pickle.c anymore.
See issue 11564.
--
resolution: - out of date
stage: patch review - committed/rejected
status: open - closed
___
Python
Marko Nervo ma...@python.it added the comment:
But so does functools.partial. So the question is, what use case does it
help that functools.partial doesn't?
Sure, it's common `defining new functions on other functions`... more times.
Here a stupid example with fold (our reduce).
@curry
def
Antoine Pitrou pit...@free.fr added the comment:
Sure, it's common `defining new functions on other functions`... more
times. Here a stupid example with fold (our reduce).
@curry
def fold(function, start, sequence):
if len(sequence) == 0:
return start
else:
1 - 100 of 110 matches
Mail list logo