[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", "credi

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

[issue20380] __defaults__ changed by *args

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

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

[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 <http://bugs.pyt

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

[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 <http://bugs.python.org/issue20380> ___ ___ Python-bugs-list mailing list Unsub

[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

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

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

[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 <http://bugs.python.o

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

[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 <http://bugs.python.org/issue20218> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1515] deepcopy doesn't copy instance methods

2009-11-25 Thread Ram Rachum
Ram Rachum added the comment: (I see some time has passed since the last message. I'm assuming the issue wasn't fixed, correct me if I'm wrong.) Here's a use case for using deepcopy: I'm developing a simulations framework called GarlicSim, all Python. You can see

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

2010-05-17 Thread Ram Rachum
Ram Rachum added the comment: +1 for this issue; I've also wished for this feature in the past. -- nosy: +cool-RR ___ Python tracker <http://bugs.python.org/i

[issue28811] Make pathlib.PurePath.__str__ use shlex.quote

2016-11-27 Thread Ram Rachum
New submission from Ram Rachum: I have a a PurePath object like so: path = PurePath('/home/my awesome user/file.txt') I'm SSHing into a server and I want to remove the file. So I have to do this: ssh_client.run(f'/bin/rm {shlex.quote(str(path))}') Whic

[issue28811] Make pathlib.PurePath.__str__ use shlex.quote

2016-11-27 Thread Ram Rachum
Ram Rachum added the comment: "This will break any code that pass str(path) to API that doesn't support pathlib." I don't understand. Can you give a concrete example of code it would break? -- ___ Python tracker <http://bug

[issue28811] Make pathlib.PurePath.__str__ use shlex.quote

2016-11-28 Thread Ram Rachum
Ram Rachum added the comment: I understand now, you're completely right. This change would break the entire world :) -- ___ Python tracker <http://bugs.python.org/is

[issue28817] Provide method PurePath.quote() that calls shlex.quote

2016-11-28 Thread Ram Rachum
New submission from Ram Rachum: I have a a PurePath object like so: path = PurePath('/home/my awesome user/file.txt') I'm SSHing into a server and I want to remove the file. So I have to do this: ssh_client.run(f'/bin/rm {shlex.quote(str(path))}') Whic

[issue28817] Provide method PurePath.quote() that calls shlex.quote

2016-11-28 Thread Ram Rachum
Changes by Ram Rachum : -- versions: +Python 3.7 -Python 3.6 ___ Python tracker <http://bugs.python.org/issue28817> ___ ___ Python-bugs-list mailing list Unsub

[issue28953] Use `raise from` when raising new IncompleteRead

2016-12-12 Thread Ram Rachum
New submission from Ram Rachum: I had this error come up in my code, and because it doesn't use `raise ... from` I thought that the second error was unexpected, while in fact it wasn't. This patch should fix that. -- components: Library (Lib) files: 1.patch keywords: patc

[issue28953] Use `raise from` when raising new IncompleteRead

2016-12-12 Thread Ram Rachum
Changes by Ram Rachum : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue28953> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue29036] logging module: Add `full_module_name` to LogRecord details

2016-12-21 Thread Ram Rachum
New submission from Ram Rachum: LogRecord currently supplies `module` that you can show in your messages, but it's just the name of the module without the path. It'll be nice to have `full_module_name` that has the qualified name (e.g. foo.bar.baz instead of baz.) Usually it'

[issue27181] Add geometric mean to `statistics` module

2016-06-02 Thread Ram Rachum
Changes by Ram Rachum : -- components: Library (Lib) nosy: cool-RR priority: normal severity: normal status: open title: Add geometric mean to `statistics` module type: enhancement versions: Python 3.6 ___ Python tracker <http://bugs.python.

[issue27181] Add geometric mean to `statistics` module

2016-06-02 Thread Ram Rachum
Ram Rachum added the comment: To complicate things further... I implemented a geometric mean on my own, and then I figured out what I really want is a *weighted* geometric mean, so I implemented that for myself. If you'd want to include that, that'll be cool. Actually I'm not s

[issue27181] Add geometric mean to `statistics` module

2016-06-04 Thread Ram Rachum
Ram Rachum added the comment: And of course, if the goal of the `statistics` module is to be comprehensive, one should ask himself what should be the difference between this new module and a mature statistics module like `scipy.stats`, and whether we should try to copy the features of off

[issue27563] docs for `gc.get_referrers` should explain the result format (i.e. what keys in the dict mean)

2016-07-18 Thread Ram Rachum
Changes by Ram Rachum : -- assignee: docs@python components: Documentation nosy: cool-RR, docs@python priority: normal severity: normal status: open title: docs for `gc.get_referrers` should explain the result format (i.e. what keys in the dict mean) versions: Python 2.7, Python 3.2

[issue27563] docs for `gc.get_referrers` should explain the result format (i.e. what keys in the dict mean)

2016-07-18 Thread Ram Rachum
New submission from Ram Rachum: My mistake -- resolution: -> not a bug status: open -> closed ___ Python tracker <http://bugs.python.org/issue27563> ___ ___

[issue27597] Add usage examples for TracebackException, StackSummary and FrameSummary

2016-07-23 Thread Ram Rachum
New submission from Ram Rachum: I saw these new interesting classes in the `traceback` docs, but if I were shown an example of how they are used, I might get inspired to use them in my own code. -- assignee: docs@python components: Documentation messages: 271072 nosy: cool-RR, docs

[issue27604] More details about `-O` flag

2016-07-24 Thread Ram Rachum
New submission from Ram Rachum: I wanted to ensure that the `-O` flag doesn't really do anything more than remove assert statement and make `__debug__` equal `False`. But the documentation for `-O` doesn't cover it: https://docs.python.org/3/using/cmdline.html#cmdoptio

[issue27604] More details about `-O` flag

2016-07-24 Thread Ram Rachum
Ram Rachum added the comment: So... The reasoning is that if someone adds optimizations to Python's `-O` mode (Something that hasn't happened in the last decade or two, right?) we want to save them from going to the trouble of writing two or three sentences in the docs desc

[issue27604] More details about `-O` flag

2016-07-25 Thread Ram Rachum
Ram Rachum added the comment: Yes, my comment was antagonistic. I'm baffled that the first response to someone who wants to contribute to Python is an esoteric argument against the contribution. I understand that sometimes not all contributions can be accepted because they break exi

[issue27604] More details about `-O` flag

2016-07-25 Thread Ram Rachum
Ram Rachum added the comment: Thanks for your understanding David. I'll submit a patch for this issue soon. -- ___ Python tracker <http://bugs.python.org/is

[issue27604] More details about `-O` flag

2016-07-25 Thread Ram Rachum
Ram Rachum added the comment: I'm sorry everyone, for being unpleasant on this thread. Rereading the thread from the beginning, I think I misunderstood Brett's message and immediately saw it as someone trying to block my efforts rather than just answering the question I asked.

[issue27604] More details about `-O` flag

2016-07-29 Thread Ram Rachum
Ram Rachum added the comment: I uploaded a new patch. I added another thing: Mentioning explicitly that no other optimizations are currently being made. I think this is important because it's often the question that the user is asking themselves. (At least my boss and team members have

[issue27604] More details about `-O` flag

2016-07-29 Thread Ram Rachum
Ram Rachum added the comment: Hi David, I attached a patch that follows your instructions, but to be honest, if I wasn't the person writing this patch and I wanted to find the information "Does Python do any optimization besides dumping asserts when I do -O?" I'm not

[issue27650] Implement `__repr__` methods for logging.Logger and others

2016-07-29 Thread Ram Rachum
New submission from Ram Rachum: A while ago I was debugging through code that uses the `logging` module, and I was looking at `Logger` objects and possibly other kinds of objects (maybe handlers? It was a while ago.) I was frustrated because I was trying to figure out what a particular logger

[issue27604] More details about `-O` flag

2016-07-30 Thread Ram Rachum
Ram Rachum added the comment: Hmm. What do you think about merging 3.patch now, and then possibly adding more information later? (Or asking the people who are designing the complex behvior you describe to write those docs.) -- ___ Python tracker

[issue27604] More details about `-O` flag

2016-07-30 Thread Ram Rachum
Ram Rachum added the comment: Well, I guess we had a fun week exchanging a couple thousand words about a two-line change to the docs that's now never going to happen ;) -- ___ Python tracker <http://bugs.python.org/is

[issue27650] Implement `__repr__` methods for logging.Logger and others

2016-08-06 Thread Ram Rachum
Ram Rachum added the comment: Vinay: Looks good to me. What do you think about adding tests? -- ___ Python tracker <http://bugs.python.org/issue27650> ___ ___

[issue27650] Implement `__repr__` methods for logging.Logger and others

2016-08-06 Thread Ram Rachum
Ram Rachum added the comment: If you want, I can implement them. -- ___ Python tracker <http://bugs.python.org/issue27650> ___ ___ Python-bugs-list mailin

[issue27650] Implement `__repr__` methods for logging.Logger and others

2016-08-06 Thread Ram Rachum
Ram Rachum added the comment: Okay, but consider that if there are no tests, this code will never be run during testing. Consider that if there's a bug in that code that causes an exception to be raised (unlikely, I know, but maybe from the call to getLevelName) it won't be discover

[issue27181] Add geometric mean to `statistics` module

2016-08-08 Thread Ram Rachum
Ram Rachum added the comment: Thanks for the patch Steven! I won't comment about the code because I don't know enough about these algorithms, but I'm thinking, since you also did a refactoring of the statistics module, maybe these should be two separate patches/commits so it&#x

[issue27181] Add geometric mean to `statistics` module

2016-08-08 Thread Ram Rachum
Ram Rachum added the comment: Also... I like the detailed docstrings with the real-life examples! That stuff helps when coding and using an unfamiliar function (since I see the docs in a panel of my IDE), so I wish I'd see more detailed docstrings like these ones in the standard library

[issue27181] Add geometric mean to `statistics` module

2016-08-09 Thread Ram Rachum
Ram Rachum added the comment: I meant the mathematical definition. -- ___ Python tracker <http://bugs.python.org/issue27181> ___ ___ Python-bugs-list mailin

[issue27775] `shlex.split(None)` causes infinite loop

2016-08-16 Thread Ram Rachum
New submission from Ram Rachum: I had a code that would freeze, and after debugging I realized that a bug in my code caused `shlex.split(None)` to be called, which puts Python in an infinite loop. We probably want to do an `if not isinstance(s, ...): raise TypeError('Bla bla')` at

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

2013-03-02 Thread Ram Rachum
Ram Rachum added the comment: Was the patch applied? Is there any reason why it should not be applied? -- ___ Python tracker <http://bugs.python.org/issue17

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

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

2013-03-02 Thread Ram Rachum
Changes by Ram Rachum : Removed file: http://bugs.python.org/file29006/cpython_patch1of1_8e9346e7ae87.patch ___ Python tracker <http://bugs.python.org/issue17

[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 <http://bugs.python.org/issue17032> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

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

2014-10-10 Thread Ram Rachum
Ram Rachum added the comment: Ethan: I'm very confused by your example. `huh` isn't even a method, why would it be included? Or are you saying "if it was a method"? I'm really not sure what your example is adding over mine, given that it's 10 times longer and m

[issue22652] Add suggestion about keyword arguments to this error message: "builtins.TypeError: my_func() takes 1 positional argument but 2 were given"

2014-10-16 Thread Ram Rachum
New submission from Ram Rachum: When programming, I just got this exception: builtins.TypeError: my_func() takes 1 positional argument but 2 were given After a couple of minutes of investigation I figured out that the problem is that the function has a `*` in its signature, so arguments

[issue22652] Add suggestion about keyword arguments to this error message: "builtins.TypeError: my_func() takes 1 positional argument but 2 were given"

2014-10-16 Thread Ram Rachum
Ram Rachum added the comment: (I should note that I see this suggestion as low-priority, because it's very specific, so I'll completely understand if it's deemed to not be worth the added complexity.) -- ___ Python tracker <http

[issue22570] Better stdlib support for Path objects

2014-10-16 Thread Ram Rachum
Ram Rachum added the comment: I agree with Brett. Making old functions support `Path` sounds trivial to me, and I don't think there are any backward compatibility issues. Having to do str(path) every time you call a function is ugly. So I think that all stdlib functions that currently t

[issue22570] Better stdlib support for Path objects

2014-10-16 Thread Ram Rachum
Ram Rachum added the comment: Fine, so you add an `if isinstance...` in front of it and you're done. -- ___ Python tracker <http://bugs.python.org/is

[issue22570] Better stdlib support for Path objects

2014-10-16 Thread Ram Rachum
Ram Rachum added the comment: Georg: You're right, I forgot about C modules which make this not as trivial as I thought. As for Python modules: If there's general agreement that this is a feature we want, I'll be happy to make a patch for the `zipfile` module to accept `P

[issue22656] `help` ignores `__doc__` of descriptors

2014-10-17 Thread Ram Rachum
New submission from Ram Rachum: The builtin `property` lets you specify a `doc` argument for your properties, which is great because then it shows up in `help`. So I figured that when I'm writing my own descriptor, I could set `__doc__` on it and have `help` use it. Not so, `help` ignor

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

2014-10-21 Thread Ram Rachum
Ram Rachum added the comment: Thanks for the fix Ethan. Will you also push this to the backport on PyPI? -- ___ Python tracker <http://bugs.python.org/issue22

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

2014-10-21 Thread Ram Rachum
Ram Rachum added the comment: Thanks! Two questions: 1. Is there a GitHub repo for enum34? Couldn't find a link to it on the PyPI page. 2. Aren't 'name' and 'value' already included in `added_behavior`? -- ___

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

2014-10-21 Thread Ram Rachum
Ram Rachum added the comment: Also, aren't you excluding a lot of important magic methods from that `dir`? -- ___ Python tracker <http://bugs.python.org/is

[issue22515] Implement partial order on Counter

2014-11-19 Thread Ram Rachum
Ram Rachum added the comment: Hi everyone, Just wanted to follow up here that I've created my own dedicated bag class. Documentation: https://combi.readthedocs.org/en/stable/bags.html Install using `pip install combi` It's packed with features. There are a ton of arithmetic

[issue24337] Implement `http.client.HTTPMessage.__repr__` to make debugging easier

2015-05-31 Thread Ram Rachum
Changes by Ram Rachum : -- components: Library (Lib) nosy: cool-RR priority: normal severity: normal status: open title: Implement `http.client.HTTPMessage.__repr__` to make debugging easier type: enhancement versions: Python 3.5 ___ Python tracker

[issue24337] Implement `http.client.HTTPMessage.__repr__` to make debugging easier

2015-05-31 Thread Ram Rachum
Ram Rachum added the comment: Regarding a unified `__repr__`: Sounds good. What I needed is to know whether there are any headers in there or not. So the number of headers, or the first 2-3, would have solved my problem. -- ___ Python tracker

[issue24394] TypeError: popitem() takes no keyword arguments

2015-06-06 Thread Ram Rachum
New submission from Ram Rachum: Python 3.5.0b2 (v3.5.0b2:7a088af5615b, May 31 2015, 06:22:19) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

[issue24394] TypeError: popitem() takes no keyword arguments

2015-06-06 Thread Ram Rachum
Ram Rachum added the comment: I'm seeing a similar problem with `move_to_end` and its `last` keyword argument. -- ___ Python tracker <http://bugs.python.org/is

[issue24195] Add `Executor.filter` to concurrent.futures

2015-06-06 Thread Ram Rachum
Ram Rachum added the comment: A problem I just realized with Brian's 2-line implementation of `filter`: It doesn't work for iterables which aren't sequences, since it attempts to exhaust the iterable twice. So if you have a non-sequence you'll have to make it in

[issue24195] Add `Executor.filter` to concurrent.futures

2015-06-08 Thread Ram Rachum
Ram Rachum added the comment: Ethan: That's what I also thought, but then I figured that you're creating N futures anyway with an item attached to each, so it's on the same scale as creating a list, no? -- ___ Python

[issue24195] Add `Executor.filter` to concurrent.futures

2015-06-08 Thread Ram Rachum
Ram Rachum added the comment: Right, so it might be garbage-collecting the items before the futures are done being created, so the whole list wouldn't need to be saved in memory. I understand now. -- ___ Python tracker <http://bugs.py

[issue25832] Document weird behavior of `finally` when it has `break` in it

2015-12-10 Thread Ram Rachum
New submission from Ram Rachum: Today I spent 30 minutes because of weird behavior of `finally` when it has a `break` statement inside of it. (The behavior is that the exception gets suppressed, which I found unexpected.) I think this behavior should be documented. Example: c

[issue22570] Better stdlib support for Path objects

2016-01-06 Thread Ram Rachum
Ram Rachum added the comment: I thought about it some more, and personally I'd prefer each function to do `str(path)` internally rather than `if hasattr(p, 'path'): p = p.path`. Even if it means we'll have to deal with "where did that file named '' come from?

[issue22570] Better stdlib support for Path objects

2016-01-10 Thread Ram Rachum
Ram Rachum added the comment: Here's an alternate idea I thought of now. Maybe `path.path` should be a pointer to the same `Path` object, so every function will do this: str(arg.path) if hasattr(arg, 'path') else arg What I like about this is that it avoids having the pat

[issue26128] Let the subprocess.STARTUPINFO constructor take arguments

2016-01-15 Thread Ram Rachum
New submission from Ram Rachum: Right now when you want to use `subprocess.STARTUPINFO`, you need to do something like this: si = subprocess.STARTUPINFO() si.dwFlags = subprocess.STARTF_USESTDHANDLES subprocess.Popen(['whatever'], startupinfo=si) It would be much nicer

[issue26128] Let the subprocess.STARTUPINFO constructor take arguments

2016-01-22 Thread Ram Rachum
Ram Rachum added the comment: Agreed on keywords-only. -- ___ Python tracker <http://bugs.python.org/issue26128> ___ ___ Python-bugs-list mailing list Unsub

[issue26978] Implement pathlib.Path.link (Using os.link)

2016-05-08 Thread Ram Rachum
Changes by Ram Rachum : -- components: Library (Lib) nosy: cool-RR priority: normal severity: normal status: open title: Implement pathlib.Path.link (Using os.link) versions: Python 3.6 ___ Python tracker <http://bugs.python.org/issue26

[issue22652] Add suggestion about keyword arguments to this error message: "builtins.TypeError: my_func() takes 1 positional argument but 2 were given"

2015-04-12 Thread Ram Rachum
Ram Rachum added the comment: ztane: I don't think so. You're taking attention away from the "and keyword-only arguments", where in fact this is the piece of information that's likely to save the user the most time, so therefore it s

[issue18162] Add index attribute to IndexError

2015-04-15 Thread Ram Rachum
Ram Rachum added the comment: Looking forward to your patch Ofer! Thanks for working on this! -- ___ Python tracker <http://bugs.python.org/issue18162> ___ ___

[issue24195] Add `Executor.filter`

2015-05-14 Thread Ram Rachum
New submission from Ram Rachum: `Executor.filter` is to `filter` what `Executor.map` is to `map`. See Python-ideas thread: https://groups.google.com/forum/#!topic/python-ideas/EBOC5YCWPyo Patch attached. I don't know how to run the Python test suite (I'm guessing it involves build

[issue24195] Add `Executor.filter`

2015-05-14 Thread Ram Rachum
Ram Rachum added the comment: Also, I notice Python 3.5 feature freeze is a bit over a week away, and I hope we can get that in so it could go in Python 3.5. (Assuming it goes in at all.) -- ___ Python tracker <http://bugs.python.org/issue24

[issue24195] Add `Executor.filter` to concurrent.futures

2015-05-15 Thread Ram Rachum
Ram Rachum added the comment: Patch with documentation attached. (I don't know how to concatenate patches, so 2.patch contains only the documentation, while 1.patch has the implementation and the tests (but Ethan's patch is better.)) Brian, regarding your simpler implementatio

[issue24195] Add `Executor.filter` to concurrent.futures

2015-05-17 Thread Ram Rachum
Ram Rachum added the comment: Okay, let me understand what the opinions of people are about this feature. Ram Rachum: +1 Antoine Pitrou: -1 Nick Coghlan: Is that a +1 or a +0? Ethan and Paul, you've participated but I didn't get your opinion on whether you want to see this feature g

[issue24195] Add `Executor.filter` to concurrent.futures

2015-05-18 Thread Ram Rachum
Ram Rachum added the comment: Looks like this a recipe in the docs is where this ticket is headed. I took my original example for `Executor.filter` and changed it using Brian's suggestion so now it uses `Executor.map`. Please check it out. If someone other than me feels comfortable in pu

[issue24195] Add `Executor.filter` to concurrent.futures

2015-05-23 Thread Ram Rachum
Ram Rachum added the comment: Raymond: Thank you. So the discussion is back on adding a recipe to the docs. Brian: When I said "possible issues", I followed that with a couple of issues with the example I uploaded (filter_example.py). --

[issue24271] Python site randomly scrolls up when on mobile.

2015-05-23 Thread Ram Rachum
New submission from Ram Rachum: I was trying to read this page: https://www.python.org/dev/peps/pep-0492/#acceptance On my mobile. (Nexus 5, chrome.) But when scrolling down the page, the browser sometimes scrolls up to the top of the page. This makes reading very annoying because I have to

[issue28278] Make `weakref.WeakKeyDictionary.__repr__` meaningful

2016-09-26 Thread Ram Rachum
New submission from Ram Rachum: Both `WeakKeyDictionary` and `WeakValueDictionary` have opaque `__repr__` methods: >>> x = weakref.WeakKeyDictionary({object: 2, type: 4,}) >>> x >>> dict(x) {: 4, : 2} This makes it annoying to view them at a glance. Is there a re

[issue28335] Exception reporting in `logging.config`

2016-10-01 Thread Ram Rachum
New submission from Ram Rachum: In `logging.config.DictConfigurator.configure`, there are exceptions that are caught and then replaced with `ValueError` exceptions. I think you should use the `raise x from y` syntax so that the original tracebacks will be preserved. (I'm debugging su

[issue28335] Exception reporting in `logging.config`

2016-10-01 Thread Ram Rachum
Ram Rachum added the comment: I now see similar raises that could use a `from` in other places in this module, so I'd suggest going over the module and putting `from`s all over the place. -- ___ Python tracker <http://bugs.python.org/is

[issue28335] Exception reporting in `logging.config`

2016-10-02 Thread Ram Rachum
Ram Rachum added the comment: You're right Vinay: I missed that first traceback because I wasn't running code in the console, I was running it with a debugger. (I'll ask my debugger vendor to maybe include these extra tracebacks.) But in any case, I think that the correct way

[issue28335] Exception reporting in `logging.config`

2016-10-02 Thread Ram Rachum
Ram Rachum added the comment: Thanks for the patch sreyas! Maybe we should also take this opportunity to remove the string formatting from the exception that shows the name of the original exception? Because when you think about it, it's just a poor man's `

[issue28335] Exception reporting in `logging.config`

2016-10-03 Thread Ram Rachum
Ram Rachum added the comment: Thanks for the quick fix Vinay! -- ___ Python tracker <http://bugs.python.org/issue28335> ___ ___ Python-bugs-list mailing list Unsub

[issue28560] Implement `PurePath.startswith` and `PurePath.endswith`

2016-10-29 Thread Ram Rachum
New submission from Ram Rachum: Today I had to check whether a path object started with `/foo`. The nicest way I could think of was `str(p).startswith('/foo')`. What do you think about implementing `p.startswith('/foo')`? -- components: Library (Lib) messages:

[issue28560] Implement `PurePath.startswith` and `PurePath.endswith`

2016-10-30 Thread Ram Rachum
Ram Rachum added the comment: I mean that `/foo` is one of the parent directories. "there are plenty of options ..." Can you please spell them out precisely? The full line of code. -- ___ Python tracker <http://bugs.python.o

[issue28560] Implement `PurePath.startswith` and `PurePath.endswith`

2016-10-30 Thread Ram Rachum
Ram Rachum added the comment: Thanks. -- resolution: -> wont fix status: open -> closed ___ Python tracker <http://bugs.python.org/issue28560> ___ ___ Pyth

[issue28608] Support creating hardlink using `pathlib`

2016-11-04 Thread Ram Rachum
Changes by Ram Rachum : -- components: Library (Lib) nosy: cool-RR priority: normal severity: normal status: open title: Support creating hardlink using `pathlib` type: enhancement versions: Python 3.7 ___ Python tracker <http://bugs.python.

[issue28623] Let `shlex.quote` accept a `PathLike` object

2016-11-06 Thread Ram Rachum
New submission from Ram Rachum: Currently it complains that you haven't fed it a string-like object. -- components: Library (Lib) messages: 280133 nosy: cool-RR priority: normal severity: normal status: open title: Let `shlex.quote` accept a `PathLike` object type: enhancement ver

[issue28624] Make the `cwd` argument to `subprocess.Popen` accept a `PathLike`

2016-11-06 Thread Ram Rachum
Changes by Ram Rachum : -- type: -> enhancement ___ Python tracker <http://bugs.python.org/issue28624> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue28624] Make the `cwd` argument to `subprocess.Popen` accept a `PathLike`

2016-11-06 Thread Ram Rachum
Changes by Ram Rachum : -- components: Library (Lib) nosy: cool-RR priority: normal severity: normal status: open title: Make the `cwd` argument to `subprocess.Popen` accept a `PathLike` versions: Python 3.7 ___ Python tracker <h

<    1   2   3   4