Ram Rachum added the comment:
(I mean, the non-positive values should be ignored.)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22515
Ram Rachum added the comment:
False, like with sets.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22515
___
___
Python-bugs-list mailing list
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 rep...@bugs.python.org
http://bugs.python.org/issue22515
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 smaller-or-equal to another if for
any
item
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 `.values
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 rep...@bugs.python.org
http://bugs.python.org
Ram Rachum added the comment:
Shall I write a patch?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22515
___
___
Python-bugs-list mailing list
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 rep...@bugs.python.org
http://bugs.python.org/issue22515
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
... three = 3
sorted
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_enum) == 7
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, copyright
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's int value
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 most importantly I
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
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 databases
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
definition order.
Likewise
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?
--
___
Python tracker rep...@bugs.python.org
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
Ram Rachum added the comment:
Oh. I wonder why `any` is slow like that, you'd figure it's be optimized.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22446
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 version
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 (AMD64
Ram Rachum added the comment:
I'd definitely consolidate.
First of all, I'd put a few useful numbers in `Executor.__repr__`. Something
like ThreadPoolExecutor(7), 3 workers busy, 0 work items queued. That already
makes to easy to get a general picture of how the executor is doing without
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 rep...@bugs.python.org
http://bugs.python.org/issue21817
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 anyone confirm
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's general
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)))
o
OrderedDict([(1, 2), (3, 4
Changes by Ram Rachum r...@rachum.com:
--
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 rep
Ram Rachum added the comment:
Sounds good.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21980
___
___
Python-bugs-list mailing list
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 rep...@bugs.python.org
http://bugs.python.org/issue21911
Ram Rachum added the comment:
obably Serhiy: Unfortunately I don't program in C, so I can't implement this.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21911
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 rep
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 requested
index
Changes by Ram Rachum r...@rachum.com:
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20218
Ram Rachum added the comment:
What do you think about exposing this directly?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18212
Ram Rachum added the comment:
Hey-ho... Anyone feels like implementing this? (I don't program in C so I
can't.)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20663
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 like it as well
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? Is
there any known
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 gave
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 number of item
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 Your idea
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-fetched, but if we
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.futures
Ram Rachum added the comment:
Maybe though this item should result in at least a test case for the future
`pprint` redesign?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21542
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 license for more information.
dd={'a': 11640
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 pyshell#5, line 1, in module
len(A())
OverflowError: cannot fit 'int' into an index-sized integer
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
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.
--
___
Python tracker rep
Changes by Ram Rachum r...@rachum.com:
--
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
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 rep...@bugs.python.org
http://bugs.python.org
Ram Rachum added the comment:
I understand Antoine.
At this point, while I could easily implement the changes you ask for in your
review, I'm concerned that we are spending our time adding a feature to Python
that nobody really loves.
What I'd really love is a pair of methods `read
New submission from Ram Rachum:
I'm trying to install Python 3.4 final on Windows 7 and it doesn't work. I'm
using the x64 MSI.
Nothing happens after running the MSI. I used Process Explorer but I can't see
any new process created. I tried restarting my computer, didn't help. I tried
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 rep...@bugs.python.org
http://bugs.python.org/issue21001
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 working happily with 3.4b2
Ram Rachum added the comment:
Thanks for the code review Antoine.
It seems like the only non-trivial comment is regarding the `append` and
`exclusive` arguments:
I don't think append and exclusive deserve to be arguments here.
write_bytes()/write_text() is a convenience method for the common
Ram Rachum added the comment:
Okay, different approach: How about having a mode argument with a default?
(Defaults of 'rb', 'r', 'wb', 'w' respectively.)
This way users who wish to use append, exclusive, or any other future mode will
be able to do that, but we won't be adding too many
Changes by Ram Rachum r...@rachum.com:
--
title: Add `pathlib.Path.write` and `pathlib.Path.read` - Add methods to
`pathlib.Path`: `write_text`, `read_text`, `write_bytes`, `read_bytes`
___
Python tracker rep...@bugs.python.org
http
Ram Rachum added the comment:
Any progress on this?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20218
___
___
Python-bugs-list mailing list
New submission from Ram Rachum:
See discussion:
https://groups.google.com/forum/#!searchin/python-ideas/iter/python-ideas/UCaNfAHkBlQ/5vX7JbpCxDkJ
`iter` has a very cool `sentinel` argument. I suggest an additional argument
`exception`; when it's supplied, instead of waiting for a sentinel
Ram Rachum added the comment:
Hi everyone,
I'm waiting for someone to review my patch. I believe it includes everything
that's needed to merge.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20218
New submission from Ram Rachum:
If there's a circular import in my program, I don't want to see an error
message, Cannot import name 'foo' and then say in my mind, ah, I'm an
experienced Python developer, I know that when Python says that it often means
that there's a circular import problem
Ram Rachum added the comment:
Patch with documentation attached.
--
Added file: http://bugs.python.org/file33840/patch.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20218
Ram Rachum added the comment:
You're right Chris, I edited the patch naively and didn't know it wouldn't
work. Your patch looks great except you probably want to change except to
accept :)
I hope I'll have time to work on the documentation addition soon. I'm assuming
we want nothing more
Ram Rachum added the comment:
If you'd like to expand this issue's scope to all the objects related to
Signature, I think that'll be good. All objects need good introspection strings.
--
___
Python tracker rep...@bugs.python.org
http
Ram Rachum added the comment:
Looks good. Ideally there would be a more details explanation and an example.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20380
Ram Rachum added the comment:
I take your point and I agree.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20380
___
___
Python-bugs-list
Ram Rachum added the comment:
New patch attached. Not tested.
--
Added file: http://bugs.python.org/file33729/pathlib.readwrite4.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20218
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'.
The first lines after each method
Changes by Ram Rachum r...@rachum.com:
--
components: Library (Lib)
nosy: cool-RR
priority: normal
severity: normal
status: open
title: Implement `Signature.__repr__`
versions: Python 3.5
___
Python tracker rep...@bugs.python.org
http
New submission from Ram Rachum:
Check the following example out. Putting *args in a function makes its
__defaults__ be empty.
Python 3.4.0b2 (v3.4.0b2:ba32913eb13e, Jan 5 2014, 16:13:26) [MSC v.1600
64 bit (AMD64)] on win32
Type help, copyright, credits or license for more
Ram Rachum added the comment:
Though perhaps a note in the documentation would be helpful for future confused
people.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20380
Ram Rachum added the comment:
My mistake. Thanks for the clarification.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20380
___
___
Python-bugs
Ram Rachum added the comment:
My impression is that the `__repr__` method of any object is intended to
describe that object, hopefully in a succinct way, possibly in a REPL-friendly
way (like `list.__repr__` for example) but if not then at least
human-friendly. This is for easy introspection
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 r...@rachum.com:
Removed file: http://bugs.python.org/file33647/pathlib.readwrite2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20218
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 rep...@bugs.python.org
http://bugs.python.org/issue20218
Changes by Ram Rachum r...@rachum.com:
Removed file: http://bugs.python.org/file33616/patch.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20218
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 rep...@bugs.python.org
http://bugs.python.org/issue20218
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 signatures
Ram Rachum added the comment:
Patch attached. Is this good?
--
keywords: +patch
Added file: http://bugs.python.org/file33616/patch.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20218
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 disagree. I've done
Ram Rachum added the comment:
(Replace `is` with `if` in my code sample, typo.)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20218
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. binary=False
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
priority: normal
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 rep...@bugs.python.org
http://bugs.python.org/issue20097
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't have worked for me
Changes by Ram Rachum r...@rachum.com:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19032
___
___
Python-bugs-list
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 rep...@bugs.python.org
http://bugs.python.org/issue19032
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
New submission from Ram Rachum:
import threading
l = threading.Lock()
l.__reduce_ex__(3)
(function __newobj__ at 0x026CD8C8,
(class '_thread.lock',),
None,
None,
None)
Isn't it a bug that `__reduce_ex__` works on the non-pickleable lock object
New submission from Ram Rachum:
I have a `Future` and I want to check whether it's in finished state. It seems
like I don't have a method to do that, right? (I could emulate the existing
methods for checking Future state, but that would mean fiddling with private
variables.)
Why not just
Ram Rachum added the comment:
I guess that'd be equivalent, yes.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18212
___
___
Python-bugs-list
New submission from Ram Rachum:
There's no mention of `match.regs` in the documentation of the `re` module.
--
assignee: docs@python
components: Documentation
messages: 189859
nosy: cool-RR, docs@python
priority: normal
severity: normal
status: open
title: No mention of `match.regs
Ram Rachum added the comment:
Awesome, thanks!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
___
___
Python-bugs-list mailing list
Ram Rachum added the comment:
(I fixed the patch to not have a typo.)
--
Added file:
http://bugs.python.org/file29290/cpython_patch1of1_8e9346e7ae87.patch.txt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
Changes by Ram Rachum r...@rachum.com:
Removed file:
http://bugs.python.org/file29006/cpython_patch1of1_8e9346e7ae87.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
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 rep
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 rep...@bugs.python.org
http://bugs.python.org/issue17032
Ram Rachum added the comment:
I think I'll go for option 2, thanks.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17032
___
___
Python-bugs
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 rep...@bugs.python.org
http://bugs.python.org/issue17032
201 - 300 of 395 matches
Mail list logo