Ram Rachum added the comment:
Note: This happened on both of my computers, which leads me to believe that
it's a problem with the MSI.
--
___
Python tracker
<http://bugs.python.org/is
Ram Rachum added the comment:
Mark, perhaps you've misunderstood me. The MSI doesn't work at all, it doesn't
even start the installation process, so I can't give any thought either to
running my scripts nor to running the Python interpreter.
(By the way, I've been w
Ram Rachum added the comment:
David: It's failing on both of my computers, laptop and desktop, not just one.
Don't you guys have a simple command to create an .exe installer? This has a
good chance of solving my problem.
--
___
Pyth
Changes by Ram Rachum :
--
assignee: docs@python
components: Documentation
nosy: cool-RR, docs@python
priority: normal
severity: normal
status: open
title: List of development releases in PEPs like 429 should be links to
download pages
type: behavior
versions: Python 2.7, Python 3.1
Ram Rachum added the comment:
I looked for it for 10 minutes but couldn't find the link. I ended up using a
URL from an old script. I still don't know how I was supposed to find it.
--
___
Python tracker
<http://bugs.python.o
New submission from Ram Rachum:
Otherwise people could MITM our passwords.
--
components: Demos and Tools
messages: 215970
nosy: cool-RR
priority: normal
severity: normal
status: open
title: Provide legit HTTPS certificate for http://bugs.python.org/, redirect
HTTP to HTTPS
New submission from Ram Rachum:
I want to use big numbers for length.
>>> class A:
... __len__ = lambda self: 10 ** 20
>>> len(A())
Traceback (most recent call last):
File "", line 1, in
len(A())
OverflowError: cannot fit 'int' into an inde
New submission from Ram Rachum:
pprint doesn't work well for counters, sometimes shows them like a dict
Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "l
Ram Rachum added the comment:
Maybe though this item should result in at least a test case for the future
`pprint` redesign?
--
___
Python tracker
<http://bugs.python.org/issue21
Changes by Ram Rachum :
--
nosy: -cool-RR
___
Python tracker
<http://bugs.python.org/issue8713>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Ram Rachum:
Every single time I see the error message `global name 'X' is not defined` I
say to myself, "ah yeah, I mistyped a variable name."
But then it occurred to me, why should I have to do this mental translation
from "global name not
Ram Rachum added the comment:
Does fixing this ticket require anything more than making a change in the
string that Python uses for this exception?
--
___
Python tracker
<http://bugs.python.org/issue17
Ram Rachum added the comment:
I made a patch. Is it okay? (I don't normally use Mercurial nor work with
patches.)
--
keywords: +patch
Added file:
http://bugs.python.org/file29006/cpython_patch1of1_8e9346e7ae87.patch
___
Python tracker
Ram Rachum added the comment:
I don't program C at all. I have no idea how to compile Python or run the test
suite. It took me half an hour just to produce this patch.
--
___
Python tracker
<http://bugs.python.org/is
Ram Rachum added the comment:
I think I'll go for option 2, thanks.
--
___
Python tracker
<http://bugs.python.org/issue17032>
___
___
Python-bugs-list m
New submission from Ram Rachum:
>>> import threading
>>> l = threading.Lock()
>>> l.__reduce_ex__(3)
(,
(,),
None,
None,
None)
Isn't it a bug that `__reduce_ex__` works on the non-pickleable lock object?
--
components: Lib
Ram Rachum added the comment:
I use that to test whether an object is pickleable or not. It used to work in
Python 2.
--
___
Python tracker
<http://bugs.python.org/issue19
Ram Rachum added the comment:
Wrong, because the object itself could be pickleable but refer to a different
object which is non-pickleable. I want to know whether the object itself,
without any object it refers to, is pickleable.
Also, pickling an object could be very resource-intensive
Changes by Ram Rachum :
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue19032>
___
___
Python-bugs-list mailing list
Unsubscrib
Ram Rachum added the comment:
"Instead of copy.deepcopy, why not call itertools.tee?"
It's hard for me to give you a good answer because I submitted this ticket 2
years ago, and nowadays I don't have personal interest in it anymore.
But, I think `itertools.tee` wouldn&
New submission from Ram Rachum:
When you use `concurrent.futures.ProcessPoolExecutor` and an exception is
raised in the created process, it doesn't show you the traceback. This makes
debugging very annoying.
Example file:
#!python
import sys
import concurrent.fu
New submission from Ram Rachum:
Ditto for lists and any other place this could be applicable.
--
components: Interpreter Core
messages: 222168
nosy: cool-RR
priority: normal
severity: normal
status: open
title: "IndexError: tuple index out of range" should include the reques
Changes by Ram Rachum :
--
resolution: -> rejected
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue20218>
___
___
Python-bugs-list
Ram Rachum added the comment:
What do you think about exposing this directly?
--
___
Python tracker
<http://bugs.python.org/issue18212>
___
___
Python-bugs-list m
Ram Rachum added the comment:
Hey-ho... Anyone feels like implementing this? (I don't program in C so I
can't.)
--
___
Python tracker
<http://bugs.python.o
Ram Rachum added the comment:
I understand. Personally I think it'll be useful enough (and more useful to me
than the builtin `sentinel`), but maybe that's just me. And I guess Terry liked
it too. I don't know whether other people would
Ram Rachum added the comment:
Raymond: I do take your point about performance, and I understand that if this
results in a performance problem, then that's a good argument to not include
this feature.
But I'm baffled as to why you're asking me regarding this feature "Why?
Ram Rachum added the comment:
Josh... The reason I gave all these examples of where Python gives detailed
error messages, is not so you'd explain the obvious reason, which is that it
makes it easier to debug, figure out what's wrong with your program, and fix
it. The reason I
Ram Rachum added the comment:
Mark, again I'm finding myself saying things that are obvious to all of us: You
can figure out that "tuple index out of range" means you asked for an item
bigger than the size of the tuple, but it might be very helpful for debugging
to say the numb
Ram Rachum added the comment:
Josh, I agree with most of what you're saying. (Except the tips about debugging
are not helpful, the point is to get the information as quickly as possible
without having to make code modifications if possible.)
I can totally understand a reaction of "
Ram Rachum added the comment:
David, as a more generalized solution: Do you think it's possible to make some
kind of mechanism in Python that would change the way that an exception is
constructed based on whether it's used for control flow or not? I know that
it's a bit far-fet
Ram Rachum added the comment:
obably Serhiy: Unfortunately I don't program in C, so I can't implement this.
--
___
Python tracker
<http://bugs.python.o
Ram Rachum added the comment:
Since #21911 has been merged into this issue, I'd like to add: Please also
include the length of the sequence in the exception message. It can help with
debugging.
--
nosy: +cool-RR
___
Python tracker
Ram Rachum added the comment:
Thanks for the information about timing, Stefan and Josh. That is good to know
regardless of this ticket :)
--
___
Python tracker
<http://bugs.python.org/issue21
New submission from Ram Rachum:
Implement `__getitem__` on `OrdredDict.keys`, `OrdredDict.values` and
`OrdredDict.items`, so the following code snippet wouldn't error:
>>> from collections import OrderedDict
>>> o = OrderedDict(((1, 2), (3, 4), (5, 6)))
>&
Changes by Ram Rachum :
--
components: Library (Lib)
nosy: cool-RR
priority: normal
severity: normal
status: open
title: Implement `logging.LogRecord.__repr__`
type: enhancement
versions: Python 3.5
___
Python tracker
<http://bugs.python.
Ram Rachum added the comment:
Sounds good.
--
___
Python tracker
<http://bugs.python.org/issue21980>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ram Rachum added the comment:
Terry: Thanks for your example use case. I hope that Raymond would be convinced.
I take your point regarding summarizing the discussion, sorry about that.
Regarding me writing a test: I'm only willing to write code for a feature for
Python if there'
Ram Rachum added the comment:
Confirmed here it's working in Python 3.4, I guess it was fixed sometime in the
last few years.
I guess the only thing we'd care about now is ensuring a test for this was
added to the test suite, so there wouldn't be a regression. Can anyon
Ram Rachum added the comment:
Hi Claudiu, sorry for the silence.
This output looks great. I'd love to see that go into Python.
--
___
Python tracker
<http://bugs.python.org/is
Ram Rachum added the comment:
I'd definitely consolidate.
First of all, I'd put a few useful numbers in `Executor.__repr__`. Something
like . That already
makes to easy to get a general picture of how the executor is doing without
digging in too deeply.
Next, I'd make a pr
New submission from Ram Rachum:
The documentation for %Z (
https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior )
says it matches `EST` among others, but in practice it doesn't:
Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64
bit (
New submission from Ram Rachum:
Can't this code:
class Sequence(Sized, Iterable, Container):
# ...
def __contains__(self, value):
for v in self:
if v == value:
return True
return False
Be shortened into
Ram Rachum added the comment:
Oh. I wonder why `any` is slow like that, you'd figure it's be optimized.
--
___
Python tracker
<http://bugs.python.o
Ram Rachum added the comment:
Thanks for the clarification. Oh well, sad to see the more verbose code win,
but I guess that's life.
I tried on PyPy but the difference was even more pronounced,
0.008922450399566156 for the long version and 0.042124665810088044 for the
short ve
New submission from Ram Rachum:
I suggest making Enum members orderable, according to their order in the enum
type. Currently trying to order them raises an exception:
>>> import enum
>>> class Number(enum.Enum):
... one = 1
... two = 2
New submission from Ram Rachum:
I'd like Enum objects to expose their serial numbers. Currently it seems the
only way to get this is `MyEnum._member_names_.index(my_enum.name)`, which is
not cool because it's cumbersome and involves private variables.
Perhaps we can use `int(my_
New submission from Ram Rachum:
Calling `dir` on an enum subclass shows only the contents of that class, not
its parent classes. In normal classes, you can do this:
Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64
bit (AMD64)] on win32
Type "help",
Ram Rachum added the comment:
Right now I want it for this:
http://bugs.python.org/issue22504
Another use case I can think of is that if you store enum values in a database,
you're probably using an int field and you'd want to easily convert between an
enum and it
Ram Rachum added the comment:
Just because I want to be able to get the `int` value of an enum object,
doesn't mean I want the enum object to *be* an `int`, which is what `IntEnum`
means. I don't want it to be comparable to an int, I don't want to use
arithmetic on it, and mos
Ram Rachum added the comment:
My particular use case is that I have objects with a tuple of enum objects to
each, and I want the tuple to be in canonical order rather than random, for
convenience.
I can easily use a subclass, but I think it's general enough functionality for
it
Ram Rachum added the comment:
> https://docs.python.org/3/library/enum.html#orderedenum
As I said in the other ticket: I can easily use a subclass, but I think it's
general enough functionality for it to be included in the standard library.
I could continue the discussion about databa
Ram Rachum added the comment:
> Enum members are also defined to be unordered, so their serial number is
> meaningless.
Are you sure? The documentation says "Enumerations support iteration, in
definition order" and shows how `tuple(MyEnum)` outputs the values in
Ram Rachum added the comment:
Ethan, I saw you just marked this as "test needed". I just gave you code to
reproduce this problem. Isn't that sufficient? Or you want me to do add it to
Python's test suite?
--
___
P
New submission from Ram Rachum:
I suggest implementing `Counter.__lt__` which will be a partial order,
similarly to `set.__lt__`. That is, one counter will be considered
smaller-or-equal to another if for any item in the first counter, the second
counter has an equal or bigger amount of that
Ram Rachum added the comment:
I suggest they be ignored like in `elements`.
--
___
Python tracker
<http://bugs.python.org/issue22515>
___
___
Python-bugs-list m
Ram Rachum added the comment:
(I mean, the non-positive values should be ignored.)
--
___
Python tracker
<http://bugs.python.org/issue22515>
___
___
Python-bug
Ram Rachum added the comment:
False, like with sets.
--
___
Python tracker
<http://bugs.python.org/issue22515>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ram Rachum added the comment:
David, there's nothing here that isn't well defined. It's simply a partial
order, not a total order. We have the same for sets.
--
___
Python tracker
<http://bugs.pyt
Ram Rachum added the comment:
Ethan, I don't understand what the problem is. I also don't understand your
side note question "how does partial-ordering work for sets?" I'm not sure what
you're asking.
>> That is, one counter will be considered smalle
Ram Rachum added the comment:
To put it another way: In Python sets, `a <= b` iff `b` has everything that `a`
has, and possibly more. I'm proposing the exact same definition for counters.
True, the implementation might be different because sets are not dicts and
don't have `.v
Ram Rachum added the comment:
You're right, sorry. I meant the mathematical "for any" which means "for
every": https://en.wikipedia.org/wiki/List_of_mathematical_symbols (See "for
any;")
--
___
Python tracker
Ram Rachum added the comment:
Shall I write a patch?
--
___
Python tracker
<http://bugs.python.org/issue22515>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ram Rachum added the comment:
If that's the case I'd prefer Raymond to first say whether this feature is
generally welcome before spending my time on making a patch.
--
___
Python tracker
<http://bugs.python.o
Ram Rachum added the comment:
Matthias: Do you prefer having both `write_bytes` and `write_text` instead of
just `write` with a `binary` option? Do you prefer `append` and `exclusive`
modes to be allowed or not?
--
___
Python tracker
<h
Ram Rachum added the comment:
What do you think about changing the signature to something like this:
def read_text(self, *, encoding=None, errors=None):
This is to avoid these arguments being used positionally, which eases future
backwards compatibility changes
Ram Rachum added the comment:
I needed it for an internal calculation in a combinatorics package I'm writing.
Do you want me to take the time to explain the calculation? It's quite complex.
--
___
Python tracker
<http://bugs.python.o
Ram Rachum added the comment:
I don't see why it's so hard to imagine how this will be used. Say I have a
counter signifying how many of each product I have in my warehouse, and I have
another counter saying how many of each product a client wants. I may use
`counter2 <= count
Ram Rachum added the comment:
If/when there's general agreement that this functionality should be merged in
(assuming the implementation is acceptable), let me know and I'll be happy to
write the code and tests.
--
___
Python trac
Ram Rachum added the comment:
The real problem is that `Counter` was put into the standard library with such
lenient conditions on how it should be used-- basically looking at it as a
`dict` subclass rather than a counter, putting emphasis on implementation
rather than purpose, which was a
Ram Rachum added the comment:
Stefan: If you'd want to raise an exception, you'll need to define in which
cases. Should it raise an exception for decimal numbers? Complex numbers? etc.
Personally I'd enjoy it raising exceptions in as many situations as possible
(so we could kee
Ram Rachum added the comment:
Ah, now I understand you Stefan. That sounds like a good scheme; let any
comparison errors between the values simply propagate up.
--
___
Python tracker
<http://bugs.python.org/issue22
Ram Rachum added the comment:
Attached patch of implementation with tests. I haven't actually run this
(because I don't know how to run Python's test suite) so there are likely to be
bugs. if there's general agreement about this direction I'll figure out how to
run t
Changes by Ram Rachum :
--
components: Library (Lib)
nosy: cool-RR
priority: normal
severity: normal
status: open
title: Implement an informative `BoundArguments.__repr__`
versions: Python 3.5
___
Python tracker
<http://bugs.python.org/issue22
Ram Rachum added the comment:
Something like
I have no problem with truncation when it gets too long.
--
___
Python tracker
<http://bugs.python.org/issue22
Ram Rachum added the comment:
Em, that kind of defeats the purpose of describing the object, doesn't it?
--
___
Python tracker
<http://bugs.python.org/is
Ram Rachum added the comment:
I think the point of `__init__` is to know what the object is, and if you're
hiding the values then someone has to access the attributes to find out the
values and that sucks.
--
___
Python tracker
Ram Rachum added the comment:
Fixed patch attached. Still needs someone to run it and see whether there are
any bugs.
--
Added file: http://bugs.python.org/file36792/patch2.patch
___
Python tracker
<http://bugs.python.org/issue22
Ram Rachum added the comment:
Another thing I proposed in python-ideas is to have `__getitem__` delegate to
`.arguments`, so this proposal is similar in spirit, because I want to have
`__repr__` show information from `.arguments`.
To be honest I don't see the point in having to a
Ram Rachum added the comment:
Yes, correct.
--
___
Python tracker
<http://bugs.python.org/issue22515>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ram Rachum added the comment:
Mark, I prefer to leave this to someone else.
--
___
Python tracker
<http://bugs.python.org/issue18043>
___
___
Python-bugs-list m
Ram Rachum added the comment:
I don't really understand the refactoring. For example why is `len(self) <=
len(other)` needed? For which case? Note that `len` would also catch keys with
`0` value which shouldn't have an effect.
--
___
P
Ram Rachum added the comment:
> There are some properties of set comparison:
>
> (a < b) == (a <= b and a != b)
I don't think so, because counter equality is based on dict equality so it
doesn't ignore zero values.
> (a <= b) == (a < b or a == b)
No, ditto.
Ram Rachum added the comment:
I see that in my implementation for __lt__ and __gt__ I forgot to check whether
the other counter has elements that this counter doesn't, which could flip
`found_strict_difference`.
--
___
Python tracker
Ram Rachum added the comment:
Hi everybody,
I agree we have a mess on our hands, with lots of cases where comparison is
weird. To be honest I've given up on `collections.Counter` at this point. The
fact that it's a "hybrid mapping/multiset" is the cause of all the problems
New submission from Ram Rachum:
There's a bad usage of `self` here:
http://hg.python.org/cpython/file/fd846837492d/Lib/importlib/_bootstrap.py#l1431
`self` isn't defined because it's a class method.
--
components: Library (Lib)
messages: 207105
nosy: cool-RR
p
Ram Rachum added the comment:
Sorry, bad link, this is the right link:
http://hg.python.org/cpython/file/fd846837492d/Lib/importlib/_bootstrap.py#l1409
--
___
Python tracker
<http://bugs.python.org/issue20
New submission from Ram Rachum:
I'd really like to have methods `pathlib.Path.write` and `pathlib.Path.read`.
Untested implementation:
def read(self, binary=False):
with self.open('br' is binary else 'r') as file:
return file.read()
def write(self, data
Ram Rachum added the comment:
(Replace `is` with `if` in my code sample, typo.)
--
___
Python tracker
<http://bugs.python.org/issue20218>
___
___
Python-bug
Ram Rachum added the comment:
Christopher and Serhiy, I would appreciate if you could kindly explain why your
arguments, while applying to my suggestions, do not apply to the following
functions:
- `Path.stat`
- `Path.owner`
- `Path.group`
- `Path.open`
- `Path.chmod`
- `Path.lchmod
Ram Rachum added the comment:
Serhiy:
Your arguments 1 and 2 are pretty weak. (So what if an import is required? It's
still 2 lines. I thought that "Not every two line function are worth to be
added to the stdlib.")
Regarding stat being used much more often than read: I disa
Ram Rachum added the comment:
Patch attached. Is this good?
--
keywords: +patch
Added file: http://bugs.python.org/file33616/patch.patch
___
Python tracker
<http://bugs.python.org/issue20
Ram Rachum added the comment:
Hi Christopher,
I like your patch. One thing I modified is returning to use `file` as the
variable instead of `f`, since `file` is no longer a builtin in Python 3, and
descriptive variable names are important. Attached as
`pathlib.readwrite2.patch
Changes by Ram Rachum :
Removed file: http://bugs.python.org/file33647/pathlib.readwrite2.patch
___
Python tracker
<http://bugs.python.org/issue20218>
___
___
Python-bug
Ram Rachum added the comment:
You're right. I deleted my 2 patches, so `pathlib.readwrite.patch` is now the
best patch for this.
--
___
Python tracker
<http://bugs.python.org/is
Changes by Ram Rachum :
Removed file: http://bugs.python.org/file33616/patch.patch
___
Python tracker
<http://bugs.python.org/issue20218>
___
___
Python-bugs-list mailin
Ram Rachum added the comment:
Antoine:
Which parts of the API merit discussion? The method names? Whether to include
readlines/writelines? The arguments?
--
___
Python tracker
<http://bugs.python.org/issue20
Ram Rachum added the comment:
I see. I don't have an opinion about these 3 issues (readlines/writelines, size
and binary separation.) So I'm cool with making these changes.
If we do separate out the binary versions, what do you have in mind for the
method names and
Ram Rachum added the comment:
I like the patch. Except I'd like to have support for the 'x' flag in the
`write_text` and `write_bytes` methods. I suggest an argument `exclusive`,
which defaults to `False`. When `exclusive=True`, the mode will be 'x' or 'xb'.
Changes by Ram Rachum :
--
components: Library (Lib)
nosy: cool-RR
priority: normal
severity: normal
status: open
title: Implement `Signature.__repr__`
versions: Python 3.5
___
Python tracker
<http://bugs.python.org/issue20
201 - 300 of 398 matches
Mail list logo