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

2018-08-08 Thread Ram Rachum
Ram Rachum added the comment: Hi Vinay, Since it's been a couple of years since I opened this ticket, I can't tell you the case in which I wanted to know the full module name of a logger. But it's probably been a logger from a third-party library. Since I can't force a third-party library

[issue34045] DoS due to null pointer dereference in marshal.dumps()

2018-07-04 Thread Krishna Ram Prakash R
New submission from Krishna Ram Prakash R : By passing a malformed string as input to marshal.loads() an attacker can trigger a null pointer dereference resulting in DoS. This happens because when a Python object is unmarshalled by reference, it is assumed that the target object is fully

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-26 Thread Stefan Ram
To: Steven D'Aprano From: "Stefan Ram" To: Steven D'Aprano From: r...@zedat.fu-berlin.de (Stefan Ram) Steven D'Aprano writes: >It has been a long, long time since Python has been a "simple" language >suitable for rank beginners, if it ever was. Python is not Scr

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-26 Thread Stefan Ram
To: Stefan Ram From: r...@zedat.fu-berlin.de (Stefan Ram) r...@zedat.fu-berlin.de (Stefan Ram) writes: >Still, one must not forget that learning Python encompasses >all the hard work it takes to learn how to program in every >language. "Beginner", however, is a very

Re: translating foreign data

2018-06-26 Thread Stefan Ram
To: Richard Damon From: "Stefan Ram" To: Richard Damon From: r...@zedat.fu-berlin.de (Stefan Ram) Richard Damon writes: >Now, if I have a parser that doesn't use the locale, but some other rule >base than I just need to provide it with the right rules, which is >basi

Re: Static variables [was Re: syntax difference]

2018-06-26 Thread Stefan Ram
To: Stefan Ram From: "Stefan Ram" To: Stefan Ram From: r...@zedat.fu-berlin.de (Stefan Ram) r...@zedat.fu-berlin.de (Stefan Ram) writes: >def f(): >def g(): >g.x += 1 >return g.x >g.x = 0 >return g Or, "for all g to sha

Re: Static variables [was Re: syntax difference]

2018-06-26 Thread Stefan Ram
To: Steven D'Aprano From: "Stefan Ram" To: Steven D'Aprano From: r...@zedat.fu-berlin.de (Stefan Ram) Steven D'Aprano writes: >def f(): >static x = 0 >def g(): >x += 1 >return x >return g What one can do today: main.py def g():

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread Stefan Ram
To: Steven D'Aprano From: r...@zedat.fu-berlin.de (Stefan Ram) Steven D'Aprano writes: >It has been a long, long time since Python has been a "simple" language >suitable for rank beginners, if it ever was. Python is not Scratch. Python is simpler insofar as you can write o

Re: translating foreign data

2018-06-24 Thread Stefan Ram
To: Richard Damon From: r...@zedat.fu-berlin.de (Stefan Ram) Richard Damon writes: >Now, if I have a parser that doesn't use the locale, but some other rule >base than I just need to provide it with the right rules, which is >basically just defining the right locale. Here's an

Re: Static variables [was Re: syntax difference]

2018-06-24 Thread Stefan Ram
To: Steven D'Aprano From: r...@zedat.fu-berlin.de (Stefan Ram) Steven D'Aprano writes: >def f(): >static x = 0 >def g(): >x += 1 >return x >return g What one can do today: main.py def g(): g.x += 1 return g.x g.x = 0 print( g() )

Re: Static variables [was Re: syntax difference]

2018-06-24 Thread Stefan Ram
To: Stefan Ram From: r...@zedat.fu-berlin.de (Stefan Ram) r...@zedat.fu-berlin.de (Stefan Ram) writes: >def f(): >def g(): >g.x += 1 >return g.x >g.x = 0 >return g Or, "for all g to share the same x": main.py def f():

Re: While, If, Count Statements

2017-11-27 Thread Stefan Ram
Cai Gengyang writes: Statement 0: >count = 0 Statement 1: >if count < 5: > print "Hello, I am an if statement and count is", count Statement 2: >while count < 10: > print "Hello, I am a while and count is", count > count += 1 There are three statements

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-27 Thread Stefan Ram
Ram) (Stefan Ram) Greg Tibbet <gtibbe...@msn.com> writes: >I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit >of Java and trying to learn this new-fangled Python language! Which actually is older than Java. >def ellipse(self, xy, fill=None, outline=None): &

Re: Stopping an iterator and continuing later

2017-11-26 Thread Stefan Ram
r...@zedat.fu-berlin.de (Stefan Ram) writes: >Then you can use pickle or custom methods to save and >restore the object, or get the state from an iterator >and create a new iterator with that state later. One does not always have to write a custom class, for example: main.py impo

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread Stefan Ram
Greg Tibbet writes: >I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit >of Java and trying to learn this new-fangled Python language! Which actually is older than Java. >def ellipse(self, xy, fill=None, outline=None): >"""Draw an ellipse.""" >

Re: Stopping an iterator and continuing later

2017-11-26 Thread Stefan Ram
r...@zedat.fu-berlin.de (Stefan Ram) writes: >Then you can use pickle or custom methods to save and >restore the object, or get the state from an iterator >and create a new iterator with that state later. One does not always have to write a custom class, for example: main.py impo

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread Stefan Ram
Greg Tibbet writes: >I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit >of Java and trying to learn this new-fangled Python language! Which actually is older than Java. >def ellipse(self, xy, fill=None, outline=None): >"""Draw an ellipse.""" >

[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's the logger's

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

2016-12-12 Thread Ram Rachum
Changes by Ram Rachum <r...@rachum.com>: -- type: -> behavior ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28953> ___ ___

[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: patch messages

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

2016-11-28 Thread Ram Rachum
Changes by Ram Rachum <r...@rachum.com>: -- versions: +Python 3.7 -Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[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))}') Which is really long and ugly

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

[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 <rep...@bugs.pyth

[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))}') Which is really long and ugly

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

2016-11-06 Thread Ram Rachum
Changes by Ram Rachum <r...@rachum.com>: -- 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 tracke

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

2016-11-06 Thread Ram Rachum
Changes by Ram Rachum <r...@rachum.com>: -- type: -> enhancement ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28624> ___ ___

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

[issue28608] Support creating hardlink using `pathlib`

2016-11-04 Thread Ram Rachum
Changes by Ram Rachum <r...@rachum.com>: -- 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 tracke

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

[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 <rep...@bugs.pyth

[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: 279699 nosy: cool-RR

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

[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 `raise from

[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 to raise would

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

[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

[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

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

[issue27735] 'module' object has no attribute 'SIGALRM' - singal module

2016-08-11 Thread Ram Vallury
New submission from Ram Vallury: 'module' object has no attribute 'SIGALRM' SIGALRM is not identified in windows, python 2.7. There is no explicit mention of this in documentation as well. === $ python Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel

[issue26209] TypeError in smtpd module with string arguments

2016-08-09 Thread Ram Vallury
Ram Vallury added the comment: added space before word portnumber. column space adjusted -- Added file: http://bugs.python.org/file44055/smtpd_doc_updated_3.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

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

[issue27181] Add geometric mean to `statistics` module

2016-08-09 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: 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'll be easy to see

[issue26209] TypeError in smtpd module with string arguments

2016-08-08 Thread Ram Vallury
Ram Vallury added the comment: Submitting patch 2 for smtpd doc changes -- Added file: http://bugs.python.org/file44047/smtpd_doc_updated_2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26209] TypeError in smtpd module with string arguments

2016-08-08 Thread Ram Vallury
Ram Vallury added the comment: Updated the documentation of smtpd. https://docs.python.org/3/library/smtpd.html#smtpserver-objects * this is my first patch, please revert back to me or make learn if I do any mistake* -- keywords: +patch nosy: +rvallury Added file: http

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

[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 <rep...@bugs.python.org> <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: Vinay: Looks good to me. What do you think about adding tests? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

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

[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

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

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

[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. Anyway, I

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

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

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

[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#cmdoption-O https

[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

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

[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 <r...@rachum.com>: -- 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:

[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

[issue27181] Add geometric mean to `statistics` module

2016-06-03 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 sure if the goal

[issue27181] Add geometric mean to `statistics` module

2016-06-02 Thread Ram Rachum
Changes by Ram Rachum <r...@rachum.com>: -- 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 tracke

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

2016-05-08 Thread Ram Rachum
Changes by Ram Rachum <r...@rachum.com>: -- 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 <rep...@bugs.p

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

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

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

[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?!" errors. I think i

[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

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

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

[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 into a sequence first

[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. import collections

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

2015-05-31 Thread Ram Rachum
Changes by Ram Rachum r...@rachum.com: -- 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

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

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

[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

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

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

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

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

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

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

[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 should get more attention

manipulating an existing plot !

2014-11-28 Thread ram rokr
Hello, I already have a script that plots a polygon. But now I'm trying to script a python class that would enable me to import the previous plot , make instances and control it too(like specifying parameters like spacing , width, height or the like). My approach was, to create a new

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

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

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

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

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

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

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

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

[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 `Path` arguments

[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 more complex. I'm not sure why

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

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

<    1   2   3   4   5   >