Steven D'Aprano added the comment:
Georg Brandl wrote:
> The rst file is missing from your patch.
Oops! Sorry about that. Fixed now.
> I already posted a patch with statistics.rst five days ago.
> I have no idea why you ignored it.
I'm sorry if I stepped on your toes,
New submission from Steven Winfield:
The attached script creates calls symtable.symtable many times on a code
snippet that contains a single class with a method called "top", and some other
important (to trigger the behaviour) properties:
* a class variable
* at least three oth
Steven D'Aprano added the comment:
Duplicate of this: http://bugs.python.org/issue6017
--
nosy: +stevenjd
___
Python tracker
<http://bugs.python.org/is
Changes by Steven D'Aprano :
--
nosy: -stevenjd
___
Python tracker
<http://bugs.python.org/issue19332>
___
___
Python-bugs-list mailing list
Unsubscr
Steven D'Aprano added the comment:
On Sat, Nov 16, 2013 at 04:33:36PM +, Serhiy Storchaka wrote:
>
> Should we add these methods to other concrete Number subclasses (as Fraction
> and complex)?
Seems like a good idea to me. Is it worth making them part of the Number
ABC,
Steven D'Aprano added the comment:
> in many cases flat-out wrong
What advice is "flat-out wrong"? All the advice seems excellent to me:
* avoid "from spam import *" (with a very few exceptions)
* be cautious about "from spam import eggs"
* avoid bare
Steven D'Aprano added the comment:
Looks good, but I think it is better to have an "unroll" option rather than do
it automatically. I'm okay with the default being to unroll, but sometimes I
want to compare the speed between different versions of Python, and having
unroll
Steven D'Aprano added the comment:
On Wed, Jul 16, 2014 at 02:49:31PM +, Armin Rigo wrote:
> ...but I don't think PyPy should be by itself a good enough reason to
> reject this patch. It would be fine if timeit detects which
> interpreter it runs on, and only tries t
Steven D'Aprano added the comment:
On Thu, Jul 17, 2014 at 07:39:21PM +, Jim Jewett wrote:
> Note, however, that containers will normally implement item equality
> as "a is b or a==b"
We can't say "will normally", since we don't know about the inf
Steven D'Aprano added the comment:
> Many specialized reprs follow a pattern <... at {hexadecimal id}...>.
> But there are few deviations:
[...]
> Proposed patch makes these cases to conform with other reprs.
I oppose making this change. The exact format of this generic r
Steven Barker added the comment:
I think that your test patch misses the confusing/possibly wrong case. That
case is when two files have the same contents, but different mtimes. If you
attempt a shallow comparison, you'll actually get a deep comparison (reading
the whole files) and a r
Steven Barker added the comment:
I've worked on this filecmp issue some more, and I have some new patches.
First up is a patch that only modifies the tests. It has one test that fails
without the behavior patch. The test patch also modifies some other tests so
that they will work afte
Changes by Steven Barker :
Added file: http://bugs.python.org/file36239/filecmp_behavior_and_doc_fix.diff
___
Python tracker
<http://bugs.python.org/issue1234674>
___
___
Steven D'Aprano added the comment:
I agree that the documentation could be improved, but it's not really *wrong*.
Consider a glob like "spam/[abc]/*.txt". What iglob does is conceptually closer
to:
(1) generate the list of files matching "spam/a/*.txt" and yield
Steven D'Aprano added the comment:
On Thu, Aug 14, 2014 at 04:47:41PM +, Mark Dickinson wrote:
> I'm not sure it's worth fixing this, but it seems worth recording:
>
> >>> -0.5 // float('inf')
> -1.0
>
> I was expecting a value of `
Steven D'Aprano added the comment:
Thank you for the extensive examples, but I'm afraid this is not a bug.
In your code, "result" is a local variable, which means it only exists inside
the fib() function. When you try inspecting "result", it fails because there
Changes by Steven D'Aprano :
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue22202>
___
___
Python-bugs-list mailing list
Unsub
Steven Barker added the comment:
OK, I've written some tests of the new bound method repr functionality, which
I'm attaching as a patch against the current tip.
I test the basic repr output, all the cases the old code got wrong (inherited
methods, overridden methods, methods called
Changes by Steven Myint :
--
nosy: +myint
___
Python tracker
<http://bugs.python.org/issue8296>
___
___
Python-bugs-list mailing list
Unsubscribe:
Steven D'Aprano added the comment:
> It should read:
> "administrative data structures that should be not shared
> even between copies"
No. If they should NOT be shared, then making a deep copy is the correct thing
to do. The problem with deepcopy is when you actual
Steven D'Aprano added the comment:
I'm afraid I don't understand the purpose of this feature request, or what the
behaviour is.
You show a simple example:
>>> s = 'abc;;def;hij'
>>> s.split(';', offset=1)
['abc', ';def
Steven D'Aprano added the comment:
I'm dubious about this issue. It suggests that the wording of the exceptions is
part of the API of the two modules.
If the idea is just to copy the best error messages from one module to the
other, then I guess there is no harm. But if the
Steven D'Aprano added the comment:
On Fri, Sep 19, 2014 at 08:41:57PM +, Mark Lawrence wrote:
> I do not believe that any changes should be made to the re module
> until such time as there is a fully approved PEP []
Why is this so controversial? We're not talking
Steven D'Aprano added the comment:
I would be a lot more cautious about changing the gcd function. As Mark says,
there is *not* a single well-defined meaning of the gcd for negative arguments.
Even Wolfram can't decide which to use: Mathworld gives one interpretation,
Mathematica th
Steven D'Aprano added the comment:
If we are considering adding a new gcd elsewhere (say, in the math module),
then it should accept any arbitrary number of arguments, not just two. (At
least one argument though.)
Also, Mathematica supports the GCD of rational numbers, not just int
Steven D'Aprano added the comment:
For future reference, we *strongly* recommend that instead of taking a screen
shot and posting it as an attachment, you copy and paste the text directly.
Don't retype it, any decent terminal application will allow you to select and
copy the text,
Steven D'Aprano added the comment:
I'm afraid that you are mistaken about Python's argument passing semantics.
Arguments are *always* passed using the same semantics, and *never* using
either pass-by-value or pass-by-reference.
These two pages may help you understand why Py
Steven D'Aprano added the comment:
On Mon, Sep 29, 2014 at 07:33:21PM +, Ram Rachum wrote:
> I suggest implementing `Counter.__lt__` which will be a partial order,
> similarly to `set.__lt__`.
Since Counter is described as a multiset, this sounds reasonable to me.
Steven D'Aprano added the comment:
As I explained on the thread (possibly my post crossed in the mail with Ryan's
patch) I don't believe this is a bug fix. MatchObject.group has only accepted
actual ints, not longs, since Python 1.5 (tested 1.5, 2.4-2.7). Nor is there
any
Steven D'Aprano added the comment:
Ethan said:
> If it is so specialized as to only be needed in complex combinatorial
> calculations, does it belong in the general-purpose part of the
> language?
It's a multi-set, a general purpose and fairly fundamental data type.
https
Steven D'Aprano added the comment:
On Sat, Oct 04, 2014 at 07:57:16AM +, Serhiy Storchaka wrote:
> There are some properties of set comparison:
>
> (a < b) == (a <= b and a != b)
> (a <= b) == (a < b or a == b)
> (a <= b and b <= a) == (a == b)
> (a
Steven D'Aprano added the comment:
On Sat, Oct 04, 2014 at 08:38:17AM +, Ram Rachum wrote:
>
> Ram Rachum added the comment:
>
> > There are some properties of set comparison:
> >
> > (a < b) == (a <= b and a != b)
>
> I don't think so, b
Steven D'Aprano added the comment:
On Sat, Oct 04, 2014 at 10:43:02AM +, Antoine Pitrou wrote:
> Just because something is discussed doesn't mean it needs a PEP.
I know that in general discussions do not need a PEP, but we seem to be
rushing awfully fast into writing code b
New submission from steven Michalske:
When using the @property decorator the wrapped functions are not exposed for
source introspection. (At least I can't see how they are.)
The issue is then that Ipython "%psource" will show the source for the
@property as opposed to the f
New submission from Steven Barker:
Pasting multiple lines of input and then pressing Enter when IDLE is waiting to
read a single line (such as when input() or sys.stdin.readline() have been
called) will result is a multi-line string being given as the input, rather
than a single line.
This
Changes by Steven D'Aprano :
--
assignee: -> stevenjd
nosy: +stevenjd
___
Python tracker
<http://bugs.python.org/issue20389>
___
___
Python-bugs-lis
Steven D'Aprano added the comment:
Off the top of my head, I can think of three APIs:
(1) separate functions, as Nick suggests:
mean vs weighted_mean, stdev vs weighted_stdev
(2) treat mappings as an implied (value, frequency) pairs
(3) take an additional argument to switch between unwei
Changes by Steven D'Aprano :
--
assignee: -> stevenjd
___
Python tracker
<http://bugs.python.org/issue20478>
___
___
Python-bugs-list mailing list
Unsub
Changes by Steven D'Aprano :
--
assignee: -> stevenjd
___
Python tracker
<http://bugs.python.org/issue20481>
___
___
Python-bugs-list mailing list
Unsub
Steven D'Aprano added the comment:
Wolfgang,
Thanks for the patch, I have some concerns about it, but the basic idea
does look reasonable. However, I've been convinced that supporting mixed
types at all needs more careful thought. Under the circumstances, I'm
more concerned ab
Steven D'Aprano added the comment:
Attached is a patch which:
- documents that mixed types are not currently supported;
- changes the behaviour of _sum to raise TypeError on mixed input
types (mixing int and is allowed, but nothing else);
- updates the tests;
- adds some document
Steven D'Aprano added the comment:
Fix as suggested by Nick, and new test.
--
keywords: +patch
Added file: http://bugs.python.org/file33983/counter.patch
___
Python tracker
<http://bugs.python.org/is
Steven D'Aprano added the comment:
On Sat, Feb 08, 2014 at 11:29:29AM +, Stefan Krah wrote:
> This looks like a duplicate of #20536. Steven, do you think you
> have a chance to fix this before rc1?
Working on it now. Should have a patch and regression tests in 15
minutes, I
Steven D'Aprano added the comment:
See also issue 20561, which is a duplicate of this.
Fix and tests for this in the attached patch. Could somebody please commit it
for me, my ssh key apparently hasn't been registered yet.
--
assignee: -> stevenjd
keywords: +patch
New submission from steven Michalske:
When writing a regular expression to match the following text.
d = """num interesting lines: 3
1
2
3
foo"""
# I only want to match the interesting lines.
m = re.match(".+?: (\d+)\n((?:.+\n){\1})", d)
print(m)
steven Michalske added the comment:
The RE compiler will not error out, with a back reference in there...
It treats the {\1} as a literal {\1} in the string.
In [180]: re.search("(\d) fo.{\1}", '3 foo{\1}').group(0)
O
Changes by Steven Downum :
--
nosy: +Steven.Downum
___
Python tracker
<http://bugs.python.org/issue20269>
___
___
Python-bugs-list mailing list
Unsubscribe:
Steven D'Aprano added the comment:
> LF or CR cannot be part of a URI
But they can be part of a filename, at least on POSIX systems. Are you
proposing that only the Windows version of os.path.join strip LF/CR?
I don't think that it up to the join function to validate the path, a
Steven D'Aprano added the comment:
I don't know how to interpret this. Where can I find out more about refleak
mode? Thanks.
--
___
Python tracker
<http://bugs.python.o
Steven D'Aprano added the comment:
I think you may have misread PEP 8. It does not recommend a trailing underscore
for names that shadow built-ins (e.g. file_ instead of file), it only
recommends a trailing underscore when you need to use a keyword as a name (e.g.
class_ instead of
Steven D'Aprano added the comment:
If this is undefined, and I think it should be, the docs should explicitly say
so. How is this?
The union and intersection operations select elements which appear in both
operands, e.g. set([a, b, c]) & set([c, d, e]) returns set([c]). The sele
Steven Bethard added the comment:
@Armin: Doesn't that argument apply to *any* library proposed for
inclusion in the standard library? By which logic we should never add
anything to the standard library ever again. Surely you don't mean that,
so could you be more specific on what yo
Steven Bethard added the comment:
[snip]
> Fix packaging and do not dump useless stuff into the standard library to
> make it appear more modern. Decentralization is modern, not replacing
> modules in the stdlib.
I can respect that viewpoint. So what do you propose to do with
existin
Changes by Steven D'Aprano :
--
nosy: +stevenjd
___
Python tracker
<http://bugs.python.org/issue3366>
___
___
Python-bugs-list mailing list
Unsubsc
New submission from Steven D'Aprano :
In Python 2.6, .pyc files inherit the executable bit from their .py
file. This can lead to strangeness:
$ echo pass > test.py
$ chmod u+x test.py
$ python2.6 -c "import test"
$ ls -l test.pyc
-rwxrw-r-- 1 steve steve 94 2009-09
Steven Bethard added the comment:
@techtonik: If you have a specific feature request for argparse, I
recommend that you file an issue on the argparse tracker[1]. I assure
you that despite the fact that you only have need for a couple of the
constructor parameters, the rest exist because people
New submission from steven Michalske :
As a complement to the append action, an update action would update a set with
new values.
"update"
update a set with this option’s argument
justification:
adding email addresses at the command line, makes it less code to have a un
steven Michalske added the comment:
Agreed, add is the correct word, I used update because i created a set from
the list that optarg created with append.
--
___
Python tracker
<http://bugs.python.org/issue7
Steven Rumbalski added the comment:
I think this is incorrect during daylight savings time:
tzoffset = -time.timezone // 60
This should do it:
isdst = time.localtime().tm_isdst
tzoffset = -(time.altzone if isdst else time.timezone)//60
--
nosy: +srumbalski
New submission from Steven Bethard :
I just ran "setup.py bdist_msi" with NLTK which is a pure Python
package. You can see the setup.py here:
http://code.google.com/p/nltk/source/browse/trunk/nltk/setup.py. Despite
the fact that NLTK is pure Python, the generated .msi's look
Steven Bethard added the comment:
Mostly out of curiosity, why is that? With bdist_wininst, a pure Python
package would generate a version-less installer that could then be used
with any Python version.
___
Python tracker
<http://bugs.python.org/issue5
Steven Bethard added the comment:
I'm certainly no Windows API expert, but if no one takes a stab at it
sooner, maybe I can spend some time looking at this during PyCon.
I'm switching the ticket type to a feature request.
--
type: behavior -> fe
New submission from Steven D'Aprano :
The table of string formatting conversions has a mispelling:
http://docs.python.org/library/stdtypes.html#string-formatting
'u' Obselete type – it is identical to 'd'.
Should be "Obsolete".
--
assignee: geo
Steven D'Aprano added the comment:
What's wrong with this?
ob = map[x][y].overpay
if ob:
ob.blit(x, y)
Is this proposal just about saving one line?
If we allow this, how many of the following will be allowed?
if expr as name:
while expr as name:
expr as name # alternativ
Steven D'Aprano added the comment:
Regarding the proposed syntax:
if (f() == 'spam') -> name:
newname = name.replace('p', 'h')
Surely that should assign the *bool* result of comparing f()
with 'spam' to name? Doing anything else is opening
Steven D'Aprano added the comment:
Matthew suggested ~= instead of -> or "as".
I dislike this because ~= first makes me think of "approximately equal
to", and then it makes me think of augmented assignment, and only then
do I remember that although ~ is used in P
New submission from Steven Bethard :
[Suggested in issue5095 by John Machin]
The 2.6.1 documentation consists of a *single* line:
"distutils.command.bdist_msi — Build a Microsoft Installer binary
package". The docs should explain briefly what an msi file is, and why a
packager might w
Steven Bethard added the comment:
You're right that the msi feature could use some more documentation. I
created a documentation feature request: issue5563.
As to why the .msi is specific to the creating version of Python, it's
because no one has written the code necessary to
Steven Bethard added the comment:
If no one beats me to it, I plan to do this at PyCon.
--
___
Python tracker
<http://bugs.python.org/issue5563>
___
___
Pytho
Steven Bethard added the comment:
I'm thinking of stealing/condensing some of the text from here:
http://www.dcl.hpi.uni-potsdam.de/home/loewis/msipackage.html
Does that seem okay? Is any of that text no longer accurate? (E.g. does
bdist_wininst now support
Steven Bethard added the comment:
The original docs request was for a rationale for using bdist_msi
instead of bdist_wininst, but you're right there should be something at
least a little specification-y. And we probably want to keep it pretty
short, so maybe something like::
..
Steven Bethard added the comment:
The following 2 line patch adds "msi" to the list of formats (patch
against py3k trunk). I'm pretty sure this is all that it takes, but I'd
appreciate if someone with more distutils experience could glance at it.
--
keywords: +nee
Steven Bethard added the comment:
Ok, so here's what needs to happen to make this work. Note that all of
the following needs to happen at *runtime*, not at the time at which the
.msi is created:
(1) Find all sub-keys of SOFTWARE\Python\PythonCore in the registry.
These are the versions
Steven Bethard added the comment:
Here you go. I built the docs with the attached patch, and everything
looks about right to me now.
--
keywords: +patch
Added file: http://bugs.python.org/file13529/python3-bdist-msi-docs.patch
___
Python tracker
Steven Bethard added the comment:
Thanks for the link. I did play around with that code for quite a while,
and while I'm convinced there's a way to get it to work, I'm still
struggling with it. I believe the attached .vbs file does about what we
need to do, but I think I'm
Steven Bethard added the comment:
My OpenView bug was just a missing "Set". The CustomAction does seem to
be correctly gathering the Python paths from the registry and filling
the ListView now. I've still got a couple of errors showing up later in
the process, but I expect I
Changes by Steven Bethard :
--
nosy: +bethard -bediviere.historic
___
Python tracker
<http://bugs.python.org/issue1446619>
___
___
Python-bugs-list mailin
Steven Bethard added the comment:
I've run into exactly the same thing. The argparse module's
ArgumentError had a "message" attribute back in Python 2.4, and in
Python 2.6 I get the same warnings Tres is getting.
--
nosy: +bethard
__
Changes by Steven Bethard :
Removed file: http://bugs.python.org/file13536/PythonVersions.vbs
___
Python tracker
<http://bugs.python.org/issue5311>
___
___
Python-bug
Steven Bethard added the comment:
Ok, I've made some progress on this. The attached patch now generates
MSIs which are version agnostic and look up the appropriate Python
version in the registry. Some things still remaining to do:
* The ProductName needs to be modified at runtime to prefi
New submission from Steven D'Aprano :
In the itertools recipes section of the docs, powerset() is listed
twice.
http://docs.python.org/library/itertools.html#recipes
--
assignee: georg.brandl
components: Documentation
messages: 86155
nosy: georg.brandl, stevenjd
severity: n
New submission from Steven D'Aprano :
In the documentation for itertools, the Python equivalent to izip has
a typo:
yield yield tuple(map(next, iterables))
Obviously should only have a single yield.
http://docs.python.org/library/itertools.html#itertools.izip
--
ass
Steven Bethard added the comment:
I'm still stuck on getting the right name to show up in ARP.
Another problem: it seems like we have to update the ProductCode at
runtime as well - otherwise, you can only have one module installed for
all the versions of Python you have on your machine. B
Changes by Steven Bethard :
Removed file: http://bugs.python.org/file13649/bdist_msi.patch
___
Python tracker
<http://bugs.python.org/issue5311>
___
___
Python-bugs-list m
Steven Bethard added the comment:
Updated the patch to make sure ProductName is set before ValidateProductID.
--
Added file: http://bugs.python.org/file13823/bdist_msi.patch
___
Python tracker
<http://bugs.python.org/issue5
Steven Bethard added the comment:
Ok, I've been chatting with folks on microsoft.public.platformsdk.msi,
and I think the right approach here is to define a Feature for each
version of Python. Each Feature would install the exact same files, but
to a different Python directory.
One of the
Steven Bethard added the comment:
Ok, that was actually easier than I thought it would be. The new patch
introduces properties for each Python version (e.g. TARGETDIR2.4,
PYTHON.MACHINE.2.4, etc.), and disables and hides the features for any
Python versions that aren't found in the reg
Steven Bethard added the comment:
Ok, I added one final Feature that allows the user to specify an
alternate Python directory. (The PathEdit for specifying the directory
will only display if this Feature is set to be installed.)
I think this patch is pretty much ready to go in now. It could
Steven Bethard added the comment:
A slightly improved patch, using DuplicateFile instead of storing a copy
of each file for each Python version. Should keep the size of the
resulting MSI similar to the size of the currently generated MSIs.
--
Added file: http://bugs.python.org
Changes by Steven Bethard :
Removed file: http://bugs.python.org/file13847/bdist_msi.patch
___
Python tracker
<http://bugs.python.org/issue5311>
___
___
Python-bugs-list m
Steven Bethard added the comment:
Ok, one last tiny update that makes sure TARGETDIR is always set to one
of the TARGETDIRX.Ys from a Feature that is actually selected.
I swear I'm done with this now. ;-)
--
Added file: http://bugs.python.org/file13855/bdist_msi.
Changes by Steven Bethard :
Removed file: http://bugs.python.org/file13854/bdist_msi.patch
___
Python tracker
<http://bugs.python.org/issue5311>
___
___
Python-bugs-list m
Steven Bethard added the comment:
Here's an MSI generated for the argparse module.
--
Added file: http://bugs.python.org/file13856/argparse-0.9.1.win32.msi
___
Python tracker
<http://bugs.python.org/i
Steven Bethard added the comment:
@martin:
Thanks! Do I need to do something special to make the merging work
right? Or do I just apply the patch separately to the trunk and the py3k
branche?
Good point about the install script - I think the condition needs to be
("&Python%s=3"
Changes by Steven Bethard :
--
nosy: +bethard
___
Python tracker
<http://bugs.python.org/issue5926>
___
___
Python-bugs-list mailing list
Unsubscribe:
Steven Bethard added the comment:
> You commit to the trunk, then you do "svnmerge merge -r" in the
> 3k branch, then "svn commit -F svnmerge-something.txt" (in case of
> conflicts, you fix them first, of course).
Done in r72306 for trunk and r72309 for 3k. Than
New submission from Steven Bethard :
With issue5311 now resolved, bdist_msi can generate a single MSI that
can install to any number of Python versions (for pure Python modules).
Right now, you can only install or uninstall these MSIs, but it would be
nice to also provide a "Change" in
New submission from Steven D'Aprano :
I'm not sure if this is a documentation bug or a behaviour bug, or
possibly both.
The documentation warns about adding or deleting items from a dict
while iterating over it:
"Using iteritems() while adding or deleting entries in the d
Steven D'Aprano added the comment:
I agree with Terry Reedy. I'm re-opening it as a documentation bug (if
I can -- if I can't, I'll just request somebody who can do so).
--
components: -Interpreter Core
status: closed -> open
___
Steven D'Aprano added the comment:
With respect Georg, given that the behaviour won't be changed, the
documentation is simply *wrong*. It's not a matter of telling
people "don't do this" -- somebody, somewhere, is going to rely on the
documented behaviour. T
1501 - 1600 of 1942 matches
Mail list logo