Virgil Dupras added the comment:
For further references, there's also
https://mail.python.org/pipermail/python-ideas/2014-December/030547.html which
is a deeper discussion and brings even more arguments against it.
Even though I'd love to have some of my code integrated into the core
Virgil Dupras added the comment:
I could reproduce the bug on the v3.4.1 tag, on the 3.4 branch and on the
default branch. I think that one of the conditions for the bug to arise is to
have the lib64 symlink created (as described in #21197).
I reproduced the bug on Gentoo and Arch
New submission from Virgil Dupras:
There seems to have been a regression in Python 3.4.1 with pyvenv --upgrade,
and this regression seems to be caused by #21197.
It now seems impossible to use the --upgrade flag without getting a File
exists error. Steps to reproduce:
$ pyvenv env
$ pyvenv
New submission from Virgil Dupras hs...@hardcoded.net:
I try to compile Pyhton 3.3a4 on a OS X 10.7 with XCode 4.3.3 and it fails. I
tried a few configuration options, but even with a basic ./configure make,
I get this:
./python.exe -SE -m sysconfig --generate-posix-vars
Could not find
Virgil Dupras hs...@hardcoded.net added the comment:
Here's a documentation-only patch which adds a section about using vars() to
convert a namespace to a dict.
If this becomes a documentation issue, can we target Python 3.2.1 instead of
Python 3.3?
--
Added file: http
Virgil Dupras hs...@hardcoded.net added the comment:
I didn't know about vars() (well, I knew it existed, but never was quite sure
what it did).
Given that I'm not a Python newbie, I'm guessing I'm not alone in this
situation. Maybe that instead of making the Namespace iterable, we should
Virgil Dupras hs...@hardcoded.net added the comment:
I went ahead and created a patch (with test and doc) making argparse.Namespace
iterable.
--
keywords: +patch -easy
Added file: http://bugs.python.org/file20648/issue11076.diff
___
Python tracker
New submission from Virgil Dupras hs...@hardcoded.net:
Currently, there is no (documented) way to easily extract arguments in an
argparse Namespace as a dictionary. This way, it would me easy to interface a
function taking a lot of kwargs like this:
args = parser.parse_args()
my_function
New submission from Virgil Dupras hs...@hardcoded.net:
I downloaded Python 3.1.3rc1 this morning to do my civic duty of testing it. I
don't know what I'm doing wrong, but for me, test_io hangs and never completed.
I'm on OS X 10.6.5. I ran it with:
$ ./python.exe Lib/test/regrtest.py test_io
Virgil Dupras hs...@hardcoded.net added the comment:
I ran the test with the -v option flag. The malloc error don't happen at the
same place the hang up happens. The first one happens at:
test_readline (test.test_io.PyIOTest) ... ok
test_unbounded_file (test.test_io.PyIOTest) ... skipped 'test
Virgil Dupras hs...@hardcoded.net added the comment:
Nobody else can reproduce the bug? I'm not sure I can fix this (although I can
try).
I tried to re-compile 3.1.2 with the same flags and run test_io and it passes,
so something happened between 3.1.2 and 3.1.3rc1.
So, I'll give it a look
Virgil Dupras hs...@hardcoded.net added the comment:
Ooh, darn, that was it. I installed it and afterwards, the tests passed.
Sorry for the fuss, I'll keep that gotcha in mind next time.
--
resolution: - invalid
status: open - closed
___
Python
Virgil Dupras hs...@hardcoded.net added the comment:
It looks like this issue has been fixed in issue7105 already. Can we close this
ticket?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue839159
Virgil Dupras hs...@hardcoded.net added the comment:
We might as well backport Antoine's patch rather than take this one (even if
mine for 2.x already). It would be weird to have 2 wildly different patches to
solve the same problem.
Maybe close this ticket and flag issue7105 for backporting
Virgil Dupras hs...@hardcoded.net added the comment:
If I understand the patch correctly, this patch basically add a test for
relative imports. I'm pretty sure this is already testes in importlib.test.
Brett, am I right?
If yes, there's no point in applying this patch.
--
nosy
Virgil Dupras hs...@hardcoded.net added the comment:
Because importlib is already well tested and that it already has the machinery
to test __import__ instead of the importlib code, I suggest that we re-use
importlib's relative tests instead.
Attached is a patch that does this. I made sure
Virgil Dupras hs...@hardcoded.net added the comment:
Applies cleanly on the py3k branch at r83069, the tests work correctly (fail
before applying the patch, success afterwards), and, to the best of my C-API
knowledge, the C code is alright.
Oh, and it behaves as described...
Python 3.2a0
Virgil Dupras hs...@hardcoded.net added the comment:
Oops, used it wrong (but it still works correctly).
p2 = partial(p1, 2)
p2.func, p2.args
(function foo at 0x10051da68, (1, 2))
--
___
Python tracker rep...@bugs.python.org
http
Virgil Dupras hs...@hardcoded.net added the comment:
Brett, I think there's a problem with the tweak you made to the patch. There
was already a testcase called RelativeImportTests and you've hidden it (that I
why I called it ImportlibRelativeImportTests initially
New submission from Virgil Dupras hs...@hardcoded.net:
If we run 2to3 on the following code:
s = b' '
print s[0] == s
we end up with this:
s = b' '
print(s[0] == s)
However, the first code, under python2 prints True while the converted code,
under python3 prints False.
Shouldn't 2to3
Virgil Dupras hs...@hardcoded.net added the comment:
Here's another one. I hadn't realized that it was useless to target the 2.x
codebase. So I re-worked this on py3k. The change is non-trivial, since the
non-windows/non-os2 part of the code has significantly changed in 3k. This
time, since
Virgil Dupras hs...@hardcoded.net added the comment:
Since I last submitted this patch, my leet C skills have improved.
I'm submitting another patch, without the needless PyUnicode creation this
time. (Moreover, I think the previous patch was wrong to insert code before
variable declaration
Virgil Dupras hs...@hardcoded.net added the comment:
You have to tell the reader how to handle escaping. In your case, you
should send escapechar=\\ in reader()'s kwargs.
--
nosy: +vdupras
___
Python tracker rep...@bugs.python.org
http
Virgil Dupras hs...@hardcoded.net added the comment:
1. Yeah, I know. At first, that's what I wanted to do, but it resulted
in a lot of code duplication (alloc, memerror, copy), which I didn't
much like. But then again, what I ended up writing (because I realized I
had to decref the new po
Virgil Dupras hs...@hardcoded.net added the comment:
I saw this ticket as a good way to get my feet wet (I almost never touched
C) with Python's C API, so I went ahead and did the part for OS X. I also
did the Windows part, but I'm not setup to compile Python on Windows, so I
don't even know
Virgil Dupras hs...@hardcoded.net added the comment:
So, we are talking about adding a feature that could cause problem whether
cleanup is performed before tearDown or after tearDown. Don't we risk
confusing developers who are not familiar with the cleanup order?
Do we really want to add
Virgil Dupras hs...@hardcoded.net added the comment:
While the behavior cannot be reproduced in the trunk, in can be
reproduced in the 2.6 release:
$ python -W ignore
Python 2.6.1 (r261:67515, Dec 6 2008, 16:42:21)
[GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
Type help, copyright
Virgil Dupras hs...@hardcoded.net added the comment:
The documentation says:
Another difference from the StringIO module is that calling StringIO()
with a string parameter creates a read-only object. Unlike an object
created without a string parameter, it does not have write methods
Virgil Dupras hs...@hardcoded.net added the comment:
About duplicated code and performance:
When I look at the duplicated code, I don't see anything that remotely
looks like a performance tweak. Just to make sure, I made a bench:
#!/usr/bin/env python
import sys
sys.path.insert(0, 'Lib
Virgil Dupras hs...@hardcoded.net added the comment:
Oh, that's me again not correctly reading my own tests. It's the
*_are_not_held_* tests that test that no reference is kept.
I agree about the *_flushed_dead_items_* being an implementation detail
On 06 Dec 2008, at 20:38, Warren DeLano wrote:
Date: Fri, 05 Dec 2008 22:22:38 -0800
From: Dennis Lee Bieber [EMAIL PROTECTED]
Subject: Re: as keyword woes
To: python-list@python.org
Message-ID: [EMAIL PROTECTED]
I'm still in the dark as to what type of data could
even inspire the
Virgil Dupras [EMAIL PROTECTED] added the comment:
hsoft-dev:~ hsoft$ mkdir foobar
hsoft-dev:~ hsoft$ echo baz foobar/baz
hsoft-dev:~ hsoft$ chmod 000 foobar/baz
hsoft-dev:~ hsoft$ python
Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Virgil Dupras [EMAIL PROTECTED] added the comment:
This patch has gone invalid due to some recent conflicting changes. I
remade it and I'm resubmitting it hoping that it will get applied.
Added file: http://bugs.python.org/file11086/unittest_modern2.diff
New submission from Virgil Dupras [EMAIL PROTECTED]:
When running with the -3 flag, difflib creates DeprecationWarnings. I
attach a patch fixing them.
There was a note in the code saying DOES NOT WORK for x in a. However,
after my changes, tests still pass, so I removed these notices
Virgil Dupras [EMAIL PROTECTED] added the comment:
It slipped out of my mind that performance was probably important for this
module, so I ditched that nested get call and went if an if..else.
Added file: http://bugs.python.org/file10718/difflib_py3k_deprecation2.diff
On Apr 25, 4:03 pm, Kirk Strauser [EMAIL PROTECTED] wrote:
I want to subclass list so that each value in it is calculated at call
time. I had initially thought I could do that by defining my own
__getitem__, but 1) apparently that's deprecated (although I can't
find that; got a link?), and 2)
On Apr 24, 10:22 pm, Brian Munroe [EMAIL PROTECTED] wrote:
My example:
class A(object):
def __init__(self, name):
self.__name = name
def getName(self):
return self.__name
class B(A):
def __init__(self,name=None):
Virgil Dupras [EMAIL PROTECTED] added the comment:
Can't we close this ticket?
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2162
__
___
Python-bugs-list mailing list
New submission from Virgil Dupras [EMAIL PROTECTED]:
hsoft-dev:python hsoft$ python
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type help, copyright, credits or license for more information.
from cStringIO import StringIO
StringIO
Virgil Dupras [EMAIL PROTECTED] added the comment:
I had a 54 mb hotshot profile lying around, and it is indeed very long to load,
so I ran a profiling session of
hotshot.stats.load(MY_BIG_FILE) with python and stdlib of r61515, and here are
the results (the resulting prof file
is 27 mb
Virgil Dupras added the comment:
Ok then, we need a test for this. Patch attached.
However, I don't know if I applied Amaury's patch wrong or if I miss a
./configure option or something, but even with the patch, the test fails.
Another thing: Why isn't the sqlite3 test suite a part
Virgil Dupras added the comment:
u':memory:'? That already worked before the patch because the implicit
encoding with 'ascii' does not bump into any non-ascii character. Nope,
one has to call connect with a filename containing non-ascii characters.
__
Tracker
Virgil Dupras added the comment:
The documentation doesn't say anything about dircmp being supposed to
support pattern matching. This ticket is a feature request rather than a
bug.
--
components: +Library (Lib) -None
nosy: +vdupras
type: behavior - feature request
Virgil Dupras added the comment:
I made a patch to fix the problem. The cleaning up of they weakref keys or
values will be held until all references to iterators created by the
weakdict are dead.
I also couldn't resist removing code duplication of code in items(),
keys() and values
Virgil Dupras added the comment:
findTestCases is an obsolete function. From the code:
# Expose obsolete functions for backwards compatibility
__all__.extend(['getTestCaseNames', 'makeSuite', 'findTestCases'])
--
nosy: +vdupras
__
Tracker [EMAIL
New submission from Virgil Dupras:
What prompted me to do these changes is that Backward compatibility
section for 2.1 and earlier. How long are we going to keep this? According
to svn, no commit has been made on the 2.1 branch since 2003. Is it safe
to assume no unittest change is ever going
New submission from Virgil Dupras:
I've been using unittest for quite a while. One thing I got tired with is
the code duplication for file management and mocking. A few months ago I
created this nifty little TestCase subclass and I've been using it ever
since. It works quite well.
Am I
Virgil Dupras added the comment:
Shouldn't we apply this patch directly on pysqlite? Any change made to
the sqlite3 module will be overwritten in the next refresh, right?
Anyway, I'm not 100% sure, but it might already be fixed:
http://www.initd.org/tracker/pysqlite/changeset/452
So, maybe
Virgil Dupras added the comment:
Isn't it why KeyboardInterrupt is a subclass of BaseException instead of
Exception (along with SystemExit)? so that except Exception: doesn't
catch it?
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2153
Virgil Dupras added the comment:
Oh, you meant hs.path? ah yeah, it's just for tmppath(), which is of no
use except in my own stuff.
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2156
Virgil Dupras added the comment:
Well, yeah, but I'm the owner, it's not like if the copyright was a
problem. I'd gladly release it (and the test unit that goes with it) under
BSD.
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2156
Virgil Dupras added the comment:
The performance gain is rather good:
hsoft-dev:python hsoft$ ./python.exe -m timeit -s import os
os.environ['HOME']
100 loops, best of 3: 1.16 usec per loop
hsoft-dev:python hsoft$ patch -p0 environ-modern.diff
patching file Lib/os.py
hsoft-dev:python
Virgil Dupras added the comment:
+1 I've been pulling my hair off over this one too. Try this on win32:
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
Type help, copyright, credits or license for more information.
import os
os.mkdir(u'foo\xe9')
import
Virgil Dupras added the comment:
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type help, copyright, credits or license for more information.
import hotshot
hotshot.Profile('/tmp/hs').runctx('print len',{'__builtins__
Virgil Dupras added the comment:
oh crap here goes my ego... pasted the wrong line.
_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1149798
_
___
Python-bugs-list mailing
Virgil Dupras added the comment:
Well, since I brought that issue back, I might as well supply a patch. So
if indeed it is decided that hotshot.Profile.runctx() should have
__builtins__ in its globals by default, here is it.
Added file: http://bugs.python.org/file9462
Virgil Dupras added the comment:
-1 on the systematic warnings too, but what I was talking about is a
warning that would say The server you are trying to fetch your resource
from is refusing the connection. Don't cha think you misbehave? only on
5xx and 4xx responses, not on every remote
Virgil Dupras added the comment:
The blog page talked about 503 responses. What about issuing a warning
on these responses? Maybe it would be enough to make developers aware of
the problem?
Or what about in-memory caching of the DTDs? Sure, it wouldn't be as
good as a catalog or anything
Virgil Dupras added the comment:
It's a very interesting patch. I wonder why it fell into oblivion. stuff
like unicode.normalize('NFC', u'\xe9') was more than twice as fast for
me.
Making sure that all unicode is normalized can be a bottleneck in a lot
of applications (it somewhat is in my
Virgil Dupras added the comment:
If the patch would have better styling (if(onetextnode == True):), correct
the test it breaks, and even better, add new ones, I guess it
would be an acceptable one.
--
nosy: +vdupras
_
Tracker [EMAIL PROTECTED]
http
Virgil Dupras added the comment:
I wanted to start contributing to python for quite a while, so here's my very
first try (cleaning out old patchless open tickets).
So, whatever is the final decision on this, here's a patch.
CDATASection.writexml() already raises ValueError when finding
On Jan 24, 7:37 am, [EMAIL PROTECTED] wrote:
Hi
Sorry if this is a bit off topic but as unit testing is such a
cornerstone of python development I thought a few of you may be able
to share your knowledge/experiences.
I like the concept of TDD but find it difficult to put into practice
most
On Jan 24, 1:30 pm, Roel Schroeven [EMAIL PROTECTED]
wrote:
Virgil Dupras schreef:
I know what you mean by top-down vs. bottom-up and I used to have the
same dilemma, but now I would tend to agree with Albert. Your issue
with top-down or bottom-up is not relevant in TDD. The only thing
On Dec 10, 8:15 am, farsheed [EMAIL PROTECTED] wrote:
I wrote a software and I want to protect it so can not be cracked
easily. I wrote it in python and compile it using py2exe. what is the
best way in your opinion?
Don't. This is a fight you already lost. Besides, people who crack
software
On Dec 9, 1:15 am, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
Richard Jones a écrit :
Bruno Desthuilliers wrote:
class A(object):
@apply
def a():
def fget(self):
return self._a
def fset(self, val):
self._a = val
return property(**locals())
On Dec 10, 9:55 am, farsheed [EMAIL PROTECTED] wrote:
Thanks. But I ask this question technically, I mean I know nothing is
uncrackable and popular softwares are not well protected. But my
software is not that type and I don't want this specific software
popular.
It is some kind of in house
On Dec 7, 9:37 am, Lars Johansen [EMAIL PROTECTED] wrote:
I have a function that looks like this:
def Chooser(color):
if color == RED:
x = term.RED
elif color == BLUE:
x = term.BLUE
elif color == GREEN:
x =
On Dec 7, 9:05 am, Matt_D [EMAIL PROTECTED] wrote:
Hello there, this is my first post to the list. Only been working with
Python for a few days. Basically a complete newbie to programming.
I'm working with csv module as an exercise to parse out a spreadsheet
I use for work.(I am an editor for
On Dec 7, 9:03 am, grbgooglefan [EMAIL PROTECTED] wrote:
On Dec 7, 3:07 pm, Gabriel Genellina [EMAIL PROTECTED] wrote:
En Fri, 07 Dec 2007 01:24:57 -0300, grbgooglefan [EMAIL PROTECTED]
escribió:
On Dec 7, 12:17 pm, Gabriel Genellina [EMAIL PROTECTED]
wrote:
En Thu, 06 Dec 2007
This is not strictly python related, but it's not strictly TDD related
either. Anyway, here it goes.
There's something that I was never quite sure how to handle with test
units: How to handle the test unit refactoring after a method
extraction.
Let's say that you have a function foo() that does
On May 31, 3:59 am, Andreas Beyer [EMAIL PROTECTED] wrote:
Hi,
I found the following quite cryptic code, which basically reads the
first column of some_file into a set.
In Python I am used to seeing much more verbose/explicit code. However,
the example below _may_ actually be faster than the
On May 13, 11:44 am, Martin v. Löwis [EMAIL PROTECTED] wrote:
PEP 1 specifies that PEP authors need to collect feedback from the
community. As the author of PEP 3131, I'd like to encourage comments
to the PEP included below, either here (comp.lang.python), or to
[EMAIL PROTECTED]
In summary,
On May 3, 9:21 pm, Andy Terrel [EMAIL PROTECTED] wrote:
Okay does anyone know how to decorate class member functions?
The following code gives me an error:
Traceback (most recent call last):
File decorators2.py, line 33, in module
s.update()
File decorators2.py, line 13, in
On May 3, 9:33 pm, Virgil Dupras [EMAIL PROTECTED] wrote:
On May 3, 9:21 pm, Andy Terrel [EMAIL PROTECTED] wrote:
Okay does anyone know how to decorate class member functions?
The following code gives me an error:
Traceback (most recent call last):
File decorators2.py, line 33
On May 3, 9:21 pm, Andy Terrel [EMAIL PROTECTED] wrote:
Okay does anyone know how to decorate class member functions?
The following code gives me an error:
Traceback (most recent call last):
File decorators2.py, line 33, in module
s.update()
File decorators2.py, line 13, in
On Mar 21, 9:24 pm, Steve Holden [EMAIL PROTECTED] wrote:
Marcin Ciura wrote:
Steven D'Aprano wrote:
x, y, z = 1, 2, 3
x = y = z
x, y, z
(3, 3, 3)
I certainly wouldn't expect to get (2, 3, 3).
Neither would I. I must have expressed myself not clearly enough.
Currently
x = y =
On Mar 21, 10:05 pm, Steve Holden [EMAIL PROTECTED] wrote:
Virgil Dupras wrote:
On Mar 21, 9:24 pm, Steve Holden [EMAIL PROTECTED] wrote:
Marcin Ciura wrote:
Steven D'Aprano wrote:
x, y, z = 1, 2, 3
x = y = z
x, y, z
(3, 3, 3)
I certainly wouldn't expect to get (2, 3, 3
On Mar 7, 7:14 pm, Sergio Correia [EMAIL PROTECTED] wrote:
Hi,
I'm looking for an easy way to flatten a two level list like this
spam = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]
Into something like
eggs = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
There are *no* special cases (no
On Feb 25, 1:00 pm, Paddy [EMAIL PROTECTED] wrote:
I blogged on finding a new-to-me feature of Python, in that you are
allowed to nnest parameter definitions:
def x ((p0, p1), p2):
... return p0,p1,p2
... x(('Does', 'this'), 'work')
('Does', 'this', 'work')
Ruben commented that
On Feb 5, 5:48 am, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
I want to have a str with custom methods, but I have this problem:
class myStr(str):
def hello(self):
return 'hello '+self
s=myStr('world')
print s.hello() # prints 'hello world'
s=s.upper()
print s.hello() #
From your example, if you want to group every path that has the same
last 9 characters, a simple solution could be something like:
groups = {}
for path in paths:
group = groups.setdefault(path[-9:],[])
group.append(path)
I didn't actually test it, there ight be syntax errors.
J wrote:
Steve Bergman wrote:
As I study Python, I am trying to develop good, Pythonic, habits. For
one thing, I am trying to keep Guido's the style guide in mind.
And I know that it starts out saying that it should not be applied in
an absolute fashion.
However, I am finding that the 79 character
Dustan wrote:
According to the following page on Wikipedia:
http://en.wikipedia.org/wiki/Python_%28programming_language%29#Future_development
reduce is going to be removed in python 3.0. It talks of an
accumulation loop; I have no idea what that's supposed to mean. So,
MonkeeSage wrote:
On Oct 6, 6:27 pm, [EMAIL PROTECTED] (Aahz) wrote:
The following line of lightly munged code was found in a publicly
available Python library...
Yes, this violates the Holy, Inspired, Infallible Style Guide (pbuh),
which was written by the very finger of God when the
On Oct 4, 4:21 pm, gord [EMAIL PROTECTED] wrote:
As a complete novice in the study of Python, I am asking myself where this
language is superior or better suited than others. For example, all I see in
the tutorials are lots of examples of list processing, arithmetic
calculations - all in a
Fabian Steiner wrote:
I often have to deal with strings like PCI:2:3.0 or PCI:3.4:0 and
need the single numbers as tuple (2, 3, 0) or (3, 4, 0). Is there any
simple way to achieve this? So far I am using regular expressions but I
would like to avoid them ...
Regards,
Fabian Steiner
I would
MonkeeSage wrote:
OK, so the devil always loses. ;P
Regards,
Jordan
Huh? The devil always loses? *turns TV on, watches the news, turns TV
off* Nope, buddy. Quite the contrary.
--
http://mail.python.org/mailman/listinfo/python-list
87 matches
Mail list logo