[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 rep...@bugs.python.org http://bugs.python.org/issue22515

[issue22515] Implement partial order on Counter

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

[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 rep...@bugs.python.org http://bugs.python.org/issue22515

[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 smaller-or-equal to another if for any item

[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 `.values

[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 rep...@bugs.python.org http://bugs.python.org

[issue22515] Implement partial order on Counter

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

[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 rep...@bugs.python.org http://bugs.python.org/issue22515

[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 ... three = 3 sorted

[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_enum) == 7

[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, copyright

[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's int value

[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 most importantly I

[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

[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 databases

[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 definition order. Likewise

[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? -- ___ Python tracker rep...@bugs.python.org

[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

[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 rep...@bugs.python.org http://bugs.python.org/issue22446

[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 version

[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 (AMD64

[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 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

[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 rep...@bugs.python.org http://bugs.python.org/issue21817

[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 anyone confirm

[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's general

[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))) o OrderedDict([(1, 2), (3, 4

[issue21980] Implement `logging.LogRecord.__repr__`

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

[issue21980] Implement `logging.LogRecord.__repr__`

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

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

2014-07-09 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 rep...@bugs.python.org http://bugs.python.org/issue21911

[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 rep...@bugs.python.org http://bugs.python.org/issue21911

[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 rep

[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 requested index

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

2014-07-03 Thread Ram Rachum
Changes by Ram Rachum r...@rachum.com: -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20218

[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 rep...@bugs.python.org http://bugs.python.org/issue18212

[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 rep...@bugs.python.org http://bugs.python.org/issue20663

[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 like it as well

[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? Is there any known

[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 gave

[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 number of item

[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 Your idea

[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-fetched, but if we

[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.futures

[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 rep...@bugs.python.org http://bugs.python.org/issue21542

[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 license for more information. dd={'a': 11640

[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 pyshell#5, line 1, in module len(A()) OverflowError: cannot fit 'int' into an index-sized integer

[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

[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. -- ___ Python tracker rep

[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 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

[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 rep...@bugs.python.org http://bugs.python.org

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

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

[issue21001] Python 3.4 MSI installer doesn't work

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

[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 rep...@bugs.python.org http://bugs.python.org/issue21001

[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 working happily with 3.4b2

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

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

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

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

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

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

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

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

[issue20663] Introduce exception argument to iter

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

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

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

[issue20490] Show clear error message on circular import

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

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

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

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

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

[issue20378] Implement `Signature.__repr__`

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

[issue20380] __defaults__ changed by *args

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

[issue20380] __defaults__ changed by *args

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

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

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

[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'. The first lines after each method

[issue20378] Implement `Signature.__repr__`

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

[issue20380] __defaults__ changed by *args

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

[issue20380] __defaults__ changed by *args

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

[issue20380] __defaults__ changed by *args

2014-01-24 Thread Ram Rachum
Ram Rachum added the comment: My mistake. Thanks for the clarification. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20380 ___ ___ Python-bugs

[issue20378] Implement `Signature.__repr__`

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

[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 r...@rachum.com: Removed file: http://bugs.python.org/file33647/pathlib.readwrite2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20218

[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 rep...@bugs.python.org http://bugs.python.org/issue20218

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

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

[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 rep...@bugs.python.org http://bugs.python.org/issue20218

[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 signatures

[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 rep...@bugs.python.org http://bugs.python.org/issue20218

[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 disagree. I've done

[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 rep...@bugs.python.org http://bugs.python.org/issue20218

[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. binary=False

[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 priority: normal

[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 rep...@bugs.python.org http://bugs.python.org/issue20097

[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't have worked for me

[issue19032] __reduce_ex__ on lock object

2013-09-18 Thread Ram Rachum
Changes by Ram Rachum r...@rachum.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19032 ___ ___ Python-bugs-list

[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 rep...@bugs.python.org http://bugs.python.org/issue19032

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

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

2013-06-14 Thread Ram Rachum
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

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

2013-06-14 Thread Ram Rachum
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

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

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

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

2013-03-03 Thread Ram Rachum
Ram Rachum added the comment: Awesome, thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17032 ___ ___ Python-bugs-list mailing list

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

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

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

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

[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 rep

[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 rep...@bugs.python.org http://bugs.python.org/issue17032

[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 rep...@bugs.python.org http://bugs.python.org/issue17032 ___ ___ Python-bugs

[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 rep...@bugs.python.org http://bugs.python.org/issue17032

<    1   2   3   4   >