[issue21001] Python 3.4 MSI installer doesn't work

2014-03-20 Thread Ram Rachum
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

[issue21001] Python 3.4 MSI installer doesn't work

2014-03-20 Thread Ram Rachum
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

[issue21001] Python 3.4 MSI installer doesn't work

2014-03-21 Thread Ram Rachum
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

[issue21007] List of development releases in PEPs like 429 should be links to download pages

2014-03-21 Thread Ram Rachum
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

[issue21007] List of development releases in PEPs like 429 should be links to download pages

2014-03-21 Thread Ram Rachum
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

[issue21206] Provide legit HTTPS certificate for http://bugs.python.org/, redirect HTTP to HTTPS

2014-04-12 Thread Ram Rachum
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

[issue21444] __len__ can't return big numbers

2014-05-05 Thread Ram Rachum
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

[issue21542] pprint doesn't work well for counters, sometimes shows them like a dict

2014-05-20 Thread Ram Rachum
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

[issue21542] pprint doesn't work well for counters, sometimes shows them like a dict

2014-05-22 Thread Ram Rachum
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

[issue8713] multiprocessing needs option to eschew fork() under Linux

2012-12-27 Thread Ram Rachum
Changes by Ram Rachum : -- nosy: -cool-RR ___ Python tracker <http://bugs.python.org/issue8713> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17032] Misleading error message: global name 'X' is not defined

2013-01-25 Thread Ram Rachum
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

[issue17032] Misleading error message: global name 'X' is not defined

2013-02-01 Thread Ram Rachum
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

[issue17032] Misleading error message: global name 'X' is not defined

2013-02-08 Thread Ram Rachum
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

[issue17032] Misleading error message: global name 'X' is not defined

2013-02-08 Thread Ram Rachum
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

[issue17032] Misleading error message: global name 'X' is not defined

2013-02-08 Thread Ram Rachum
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

[issue19032] __reduce_ex__ on lock object

2013-09-15 Thread Ram Rachum
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

[issue19032] __reduce_ex__ on lock object

2013-09-16 Thread Ram Rachum
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

[issue19032] __reduce_ex__ on lock object

2013-09-16 Thread Ram Rachum
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

[issue19032] __reduce_ex__ on lock object

2013-09-18 Thread Ram Rachum
Changes by Ram Rachum : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue19032> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue11299] Allow deepcopying paused generators

2013-12-08 Thread Ram Rachum
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&

[issue21817] `concurrent.futures.ProcessPoolExecutor` swallows tracebacks

2014-06-20 Thread Ram Rachum
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

[issue21911] "IndexError: tuple index out of range" should include the requested index and tuple length

2014-07-03 Thread Ram Rachum
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

[issue20218] Add methods to `pathlib.Path`: `write_text`, `read_text`, `write_bytes`, `read_bytes`

2014-07-03 Thread Ram Rachum
Changes by Ram Rachum : -- resolution: -> rejected status: open -> closed ___ Python tracker <http://bugs.python.org/issue20218> ___ ___ Python-bugs-list

[issue18212] No way to check whether Future is finished?

2014-07-03 Thread Ram Rachum
Ram Rachum added the comment: What do you think about exposing this directly? -- ___ Python tracker <http://bugs.python.org/issue18212> ___ ___ Python-bugs-list m

[issue20663] Introduce exception argument to iter

2014-07-03 Thread Ram Rachum
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

[issue20663] Introduce exception argument to iter

2014-07-03 Thread Ram Rachum
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

[issue21911] "IndexError: tuple index out of range" should include the requested index and tuple length

2014-07-03 Thread Ram Rachum
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?

[issue21911] "IndexError: tuple index out of range" should include the requested index and tuple length

2014-07-03 Thread Ram Rachum
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

[issue21911] "IndexError: tuple index out of range" should include the requested index and tuple length

2014-07-03 Thread Ram Rachum
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

[issue21911] "IndexError: tuple index out of range" should include the requested index and tuple length

2014-07-03 Thread Ram Rachum
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 "

[issue21911] "IndexError: tuple index out of range" should include the requested index and tuple length

2014-07-03 Thread Ram Rachum
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

[issue21911] "IndexError: tuple index out of range" should include the requested index and tuple length

2014-07-05 Thread Ram Rachum
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

[issue18162] Add index attribute to IndexError

2014-07-05 Thread Ram Rachum
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

[issue21911] "IndexError: tuple index out of range" should include the requested index and tuple length

2014-07-08 Thread Ram Rachum
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

[issue21978] Support index access on OrderedDict views (e.g. o.keys()[7])

2014-07-14 Thread Ram Rachum
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))) >&

[issue21980] Implement `logging.LogRecord.__repr__`

2014-07-14 Thread Ram Rachum
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.

[issue21980] Implement `logging.LogRecord.__repr__`

2014-07-14 Thread Ram Rachum
Ram Rachum added the comment: Sounds good. -- ___ Python tracker <http://bugs.python.org/issue21980> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20663] Introduce exception argument to iter

2014-07-15 Thread Ram Rachum
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'

[issue11969] Can't launch multiproccessing.Process on methods

2014-07-29 Thread Ram Rachum
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

[issue21817] `concurrent.futures.ProcessPoolExecutor` swallows tracebacks

2014-08-22 Thread Ram Rachum
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

[issue22281] ProcessPoolExecutor/ThreadPoolExecutor should provide introspection APIs

2014-08-27 Thread Ram Rachum
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

[issue22377] %Z in strptime doesn't match EST and others

2014-09-09 Thread Ram Rachum
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 (

[issue22446] Shortening code in abc.py

2014-09-19 Thread Ram Rachum
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

[issue22446] Shortening code in abc.py

2014-09-19 Thread Ram Rachum
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

[issue22446] Shortening code in abc.py

2014-09-19 Thread Ram Rachum
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

[issue22504] Add ordering between `Enum` objects

2014-09-27 Thread Ram Rachum
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

[issue22505] Expose an Enum object's serial number

2014-09-27 Thread Ram Rachum
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_

[issue22506] `dir` on Enum subclass doesn't expose parent class attributes

2014-09-27 Thread Ram Rachum
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",

[issue22505] Expose an Enum object's serial number

2014-09-27 Thread Ram Rachum
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&#

[issue22504] Add ordering between `Enum` objects

2014-09-27 Thread Ram Rachum
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

[issue22504] Add ordering between `Enum` objects

2014-09-27 Thread Ram Rachum
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

[issue22505] Expose an Enum object's serial number

2014-09-27 Thread Ram Rachum
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

[issue22505] Expose an Enum object's serial number

2014-09-27 Thread Ram Rachum
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

[issue22506] `dir` on Enum subclass doesn't expose parent class attributes

2014-09-27 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-09-29 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-09-29 Thread Ram Rachum
Ram Rachum added the comment: I suggest they be ignored like in `elements`. -- ___ Python tracker <http://bugs.python.org/issue22515> ___ ___ Python-bugs-list m

[issue22515] Implement partial order on Counter

2014-09-29 Thread Ram Rachum
Ram Rachum added the comment: (I mean, the non-positive values should be ignored.) -- ___ Python tracker <http://bugs.python.org/issue22515> ___ ___ Python-bug

[issue22515] Implement partial order on Counter

2014-09-29 Thread Ram Rachum
Ram Rachum added the comment: False, like with sets. -- ___ Python tracker <http://bugs.python.org/issue22515> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22515] Implement partial order on Counter

2014-09-29 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-09-29 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-09-29 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-09-29 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-09-29 Thread Ram Rachum
Ram Rachum added the comment: Shall I write a patch? -- ___ Python tracker <http://bugs.python.org/issue22515> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22515] Implement partial order on Counter

2014-09-29 Thread Ram Rachum
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

[issue20218] Add methods to `pathlib.Path`: `write_text`, `read_text`, `write_bytes`, `read_bytes`

2014-09-30 Thread Ram Rachum
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

[issue20218] Add methods to `pathlib.Path`: `write_text`, `read_text`, `write_bytes`, `read_bytes`

2014-09-30 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-10-01 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-10-01 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-10-01 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-10-01 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-10-01 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-10-01 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-10-03 Thread Ram Rachum
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

[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Ram Rachum
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

[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Ram Rachum
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

[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Ram Rachum
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

[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-10-03 Thread Ram Rachum
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

[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-10-03 Thread Ram Rachum
Ram Rachum added the comment: Yes, correct. -- ___ Python tracker <http://bugs.python.org/issue22515> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18043] No mention of `match.regs` in `re` documentation

2014-10-04 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-10-04 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-10-04 Thread Ram Rachum
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.

[issue22515] Implement partial order on Counter

2014-10-04 Thread Ram Rachum
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

[issue22515] Implement partial order on Counter

2014-10-04 Thread Ram Rachum
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

[issue20097] Bad use of `self` in importlib

2013-12-30 Thread Ram Rachum
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

[issue20097] Bad use of `self` in importlib

2013-12-30 Thread Ram Rachum
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

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-10 Thread Ram Rachum
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

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-12 Thread Ram Rachum
Ram Rachum added the comment: (Replace `is` with `if` in my code sample, typo.) -- ___ Python tracker <http://bugs.python.org/issue20218> ___ ___ Python-bug

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-21 Thread Ram Rachum
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

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-21 Thread Ram Rachum
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

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-22 Thread Ram Rachum
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

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-23 Thread Ram Rachum
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

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-23 Thread Ram Rachum
Changes by Ram Rachum : Removed file: http://bugs.python.org/file33647/pathlib.readwrite2.patch ___ Python tracker <http://bugs.python.org/issue20218> ___ ___ Python-bug

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-23 Thread Ram Rachum
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

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-23 Thread Ram Rachum
Changes by Ram Rachum : Removed file: http://bugs.python.org/file33616/patch.patch ___ Python tracker <http://bugs.python.org/issue20218> ___ ___ Python-bugs-list mailin

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-23 Thread Ram Rachum
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

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-23 Thread Ram Rachum
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

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-24 Thread Ram Rachum
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'.

[issue20378] Implement `Signature.__repr__`

2014-01-24 Thread Ram Rachum
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

<    1   2   3   4   >