[issue39279] Don't allow non-Ascii digits in platform.py

2020-01-09 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +17335 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17928 ___ Python tracker <https://bugs.python.org/issu

[issue39280] Don't allow datetime parsing to accept non-Ascii digits

2020-01-09 Thread Ram Rachum
New submission from Ram Rachum : I've been doing some research into the use of `\d` in regular expressions in CPython, and any security vulnerabilities that might happen as a result of the fact that it accepts non-Ascii digits like ٢ and 5. In most places in the CPython codebase

[issue39279] Don't allow non-Ascii digits in platform.py

2020-01-09 Thread Ram Rachum
Change by Ram Rachum : -- pull_requests: +17336 pull_request: https://github.com/python/cpython/pull/17931 ___ Python tracker <https://bugs.python.org/issue39

[issue39280] Don't allow datetime parsing to accept non-Ascii digits

2020-01-09 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +17337 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17931 ___ Python tracker <https://bugs.python.org/issu

[issue39280] Don't allow datetime parsing to accept non-Ascii digits

2020-01-09 Thread Ram Rachum
Ram Rachum added the comment: > To me, this seems like a pretty thin justification for calling this a > security vulnerability. I know that lots of exploits were made because of bugs in Python's URL parsing, and security releases of Python were made because of that. It'

[issue39280] Don't allow datetime parsing to accept non-Ascii digits

2020-01-10 Thread Ram Rachum
Ram Rachum added the comment: Okay, since it seems like I'm the only one who wants this change, I'll let it go. Thanks for your input. -- ___ Python tracker <https://bugs.python.o

[issue39279] Don't allow non-Ascii digits in platform.py

2020-01-10 Thread Ram Rachum
Ram Rachum added the comment: My approach is that any input that's unexpected by the developer but accepted by the program could cause either a bug or a security problem, and should be rejected by the program. I don't have a specific example for this case. If you think I need

[issue39279] Don't allow non-Ascii digits in platform.py

2020-01-31 Thread Ram Rachum
Ram Rachum added the comment: Hey Victor, adding you here. This ticket is a continuation of the thread on the Python security mailing list. I see that there isn't a consensus here for changing from \d to [0-9]. Can you make a decision on whether to go ahead with this issue or not? Othe

[issue39280] Don't allow datetime parsing to accept non-Ascii digits

2020-01-31 Thread Ram Rachum
Ram Rachum added the comment: Hi guys, Can we please have a decision on whether we want to move forward with this issue or not? I have a patch in the PR, and I'll be happy to continue working on it, or close this issue if that's the decision. T

[issue39715] Implement __repr__ methods for AST classes

2020-02-21 Thread Ram Rachum
New submission from Ram Rachum : I was playing with the `ast` library today, and it's frustrating to see objects like these: [<_ast.Import object at 0x033FB048>, <_ast.Import object at 0x033FB0F0>, <_ast.ImportFrom object at 0x033FB160

[issue39717] Fix exception causes in tarfile module

2020-02-21 Thread Ram Rachum
Change by Ram Rachum : -- components: Library (Lib) nosy: cool-RR priority: normal pull_requests: 17962 severity: normal status: open title: Fix exception causes in tarfile module type: behavior versions: Python 3.9 ___ Python tracker <ht

[issue39715] Implement __repr__ methods for AST classes

2020-02-21 Thread Ram Rachum
Ram Rachum added the comment: I understand that we have to be really careful in including information that could have unlimited size. But I think we have lots of information that isn't that way. For example, for ClassDef and FunctionDef objects, we could include the name. For Assig

[issue39717] Fix exception causes in tarfile module

2020-02-21 Thread Ram Rachum
Ram Rachum added the comment: > What do you think it is necessary to switch from implicit chaining to > explicit chaining? I didn't say it's necessary, but I think it's beneficial. I find that message between exceptions useful when I'm debugging and I'd like

[issue39717] Fix exception causes in tarfile module

2020-02-21 Thread Ram Rachum
Ram Rachum added the comment: I'm also strongly against using `from None`. When I'm debugging, I'm like a man who got lost in the desert and is about to die of thirst. Any possible insight into what happened is like an oasis, even if there are just a few drops of water the

[issue39717] Fix exception causes in tarfile module

2020-02-23 Thread Ram Rachum
Ram Rachum added the comment: Ethan, did we successfully convince you not to use `from None`? -- ___ Python tracker <https://bugs.python.org/issue39717> ___ ___

[issue39717] Fix exception causes in tarfile module

2020-03-17 Thread Ram Rachum
Ram Rachum added the comment: Ethan, got a verdict? -- ___ Python tracker <https://bugs.python.org/issue39717> ___ ___ Python-bugs-list mailing list Unsub

[issue39717] Fix exception causes in tarfile module

2020-03-17 Thread Ram Rachum
Ram Rachum added the comment: I understand. I've closed my PR and I'll let someone else implement this ticket-- I don't want to be the reason that someone didn't get the information they wanted in an error report. Thanks

[issue40006] enum: Add documentation for _create_pseudo_member_ and composite members

2020-03-18 Thread Ram Rachum
New submission from Ram Rachum : Looking at the enum source code, there's a method `_create_pseudo_member_` that's used in a bunch of places. Its docstring says "Create a composite member iff value contains only members", which would have been useful if I had any idea wh

[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Ram Rachum
New submission from Ram Rachum : Today I was tripped up by an inconsistency in the `re` docstring. I wanted to use DOTALL as a flag inside my regex, rather than as an argument to the `compile` function. Here are two lines from the docstring: (?aiLmsux) Set the A, I, L, M, S, U, or X flag

[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +18434 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19078 ___ Python tracker <https://bugs.python.org/issu

[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Ram Rachum
Ram Rachum added the comment: As you can see I left the old uppercase enums defined, to avoid breaking backward compatibility. We could make them trigger a DeprecationWarning. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Ram Rachum
Ram Rachum added the comment: Well, these aren't the textbook case of a constant, since they're enums, and not defined in the global namespace. -- ___ Python tracker <https://bugs.python.o

[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Ram Rachum
Ram Rachum added the comment: Oops, my mistake. Any other idea how to solve this discrepancy? -- ___ Python tracker <https://bugs.python.org/issue40016> ___ ___

[issue40016] Clarify flag case in `re` module

2020-03-19 Thread Ram Rachum
Ram Rachum added the comment: I'm gonna look past the rudeness, and I'll just say that if I was tripped up by this, after 11 years of working with Python and the re module, then people in a beginner or intermediate level could be tripped up by this as well. Here's a

[issue40016] Clarify flag case in `re` module

2020-03-20 Thread Ram Rachum
Ram Rachum added the comment: I updated my PR to match. -- ___ Python tracker <https://bugs.python.org/issue40016> ___ ___ Python-bugs-list mailing list Unsub

[issue40353] Add an optional "strict" check to zip

2020-04-21 Thread Ram Rachum
Ram Rachum added the comment: Here are the tests I made: https://github.com/cool-RR/cpython/commit/766409748a107f290997b0cfab5aa19d0c2888e5 -- ___ Python tracker <https://bugs.python.org/issue40

[issue43002] Exception chaining accepts exception classes

2021-01-22 Thread Ram Rachum
New submission from Ram Rachum : I saw this line of code today: https://github.com/hyperledger/sawtooth-sdk-python/commit/c27b962541c9ae68fd1e6dc691ddee883234f112#diff-eb008203eae2160c5e14c42e5fd2eee164709a93bf5136fa79cc256d4e46eaffR92 I was about to tell this guy that his code is bad since

[issue43002] Exception chaining accepts exception classes

2021-01-22 Thread Ram Rachum
Ram Rachum added the comment: People barely know how to use the right form of this feature. Providing them with a wrong form that's confusingly similar to the right form and fails silently is an unfortunate choice. "Or just don't do anything. A `raise exception` inside an ex

[issue40678] Full list of Python lexical rules

2020-05-18 Thread Ram Rachum
New submission from Ram Rachum : I'm a noob on parsing, learning about it, so it's possible I've made a mistake somewhere. I know there's this page: https://docs.python.org/3/reference/grammar.html Which is a full listing of Python's grammar. However, loo

[issue40678] Full list of Python lexical rules

2020-05-23 Thread Ram Rachum
Ram Rachum added the comment: Hmm, I feel this isn't right, because I still feel like there should be one place where one can see the full Python syntax specification, lexing and parsing and all. But I'm underqualified to argue because I don't understand the details.

[issue40678] Full list of Python lexical rules

2020-05-23 Thread Ram Rachum
Ram Rachum added the comment: I understand, thank you. -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/i

[issue40752] Implement PurePath.__len__

2020-05-24 Thread Ram Rachum
New submission from Ram Rachum : I'm writing the patch now. -- components: Library (Lib) messages: 369767 nosy: cool-RR priority: normal severity: normal status: open title: Implement PurePath.__len__ type: enhancement versions: Python

[issue40752] Implement PurePath.__len__

2020-05-24 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +19611 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20348 ___ Python tracker <https://bugs.python.org/issu

[issue40752] Implement PurePath.__len__

2020-05-24 Thread Ram Rachum
Ram Rachum added the comment: Just return len(str(path)). I put the use case on the PR on GitHub. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40753] Remove Python 2 compatibility code from pathlib

2020-05-24 Thread Ram Rachum
New submission from Ram Rachum : No need to inherit from object. I'm writing the patch now. -- components: Library (Lib) messages: 369770 nosy: cool-RR priority: normal severity: normal status: open title: Remove Python 2 compatibility code from pathlib type: enhancement ver

[issue40753] Remove Python 2 compatibility code from pathlib

2020-05-24 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +19612 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20349 ___ Python tracker <https://bugs.python.org/issu

[issue40753] Remove Python 2 compatibility code from pathlib

2020-05-24 Thread Ram Rachum
Ram Rachum added the comment: "We usually do not accept such pure cosmetic changes." Is this an axiom or is the reasoning written down somewhere? I'd think we all like to remove cruft that's no longer necessary. -- ___ Py

[issue40752] Implement PurePath.__len__

2020-05-24 Thread Ram Rachum
Ram Rachum added the comment: Remi: Your use case is taken care of by `len(path.parts)`. Serhiy: "If it is not iterable, the length does not make sense." I'm not sure this is a rule. I do see that the `collections.abc.Sized` class does not require an `__iter__` metho

[issue40753] Remove Python 2 compatibility code from pathlib

2020-05-24 Thread Ram Rachum
Change by Ram Rachum : -- nosy: +brandtbucher ___ Python tracker <https://bugs.python.org/issue40753> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40752] Implement PurePath.__len__

2020-05-24 Thread Ram Rachum
Ram Rachum added the comment: I understand your argument. I think it relies on your earlier statement: "The fact the the path is stored as a string is an implementation detail." This statement reminds me of the term "architecture astronaut". Pathlib builds a cool a

[issue20002] Cleanup and microoptimize pathlib

2020-05-24 Thread Ram Rachum
Ram Rachum added the comment: Antoine: Serhiy linked me to this issue when I opened #40753 . Do you think that this patch by Serhiy could now be merged? -- nosy: +cool-RR ___ Python tracker <https://bugs.python.org/issue20

[issue40753] Remove Python 2 compatibility code from pathlib

2020-05-25 Thread Ram Rachum
Ram Rachum added the comment: Brett: Oh well, I understand. Looking at the devguide, I can't find where this is written. I'm interested in seeing how it's phrased, because I do think that tiny, incremental changes are important. I would want to know why, for example,

[issue22250] unittest lowercase methods

2020-05-28 Thread Ram Rachum
Ram Rachum added the comment: I see it's been 6 years since the last comment here. I think it's important to revisit these kind of decisions once in a while. Maybe now the time is ripe for a change? We could do it backward compatibility with a long deprecation schedule. Ezio: You

[issue40833] Clarify docstring of Path.rename

2020-05-31 Thread Ram Rachum
New submission from Ram Rachum : Writing the PR now. -- assignee: docs@python components: Documentation messages: 370459 nosy: brandtbucher, cool-RR, docs@python priority: normal severity: normal status: open title: Clarify docstring of Path.rename type: enhancement versions: Python

[issue40833] Clarify docstring of Path.rename

2020-05-31 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +19797 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20554 ___ Python tracker <https://bugs.python.org/issu

[issue40875] Implement __repr__ for classes in csv module

2020-06-05 Thread Ram Rachum
New submission from Ram Rachum : Why see this: When you can see this: It could show columns=? if they weren't read yet. Any other info would be good too. This applies to all classes in the csv module. -- components: Library (Lib) messages: 370768 nosy: cool-RR pri

[issue40876] Clarify error message in csv module

2020-06-05 Thread Ram Rachum
New submission from Ram Rachum : I was working with the csv module, and I vaguely remembered that you should open files in binary mode. So I did. Then I saw this error message: _csv.Error: iterator should return strings, not bytes (did you open the file in text mode?) I read the end

[issue40876] Clarify error message in csv module

2020-06-05 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +19873 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20653 ___ Python tracker <https://bugs.python.org/issu

[issue40976] Clarify motivation for `chain.from_iterable`

2020-06-14 Thread Ram Rachum
Change by Ram Rachum : -- components: Library (Lib) nosy: cool-RR priority: normal severity: normal status: open title: Clarify motivation for `chain.from_iterable` type: enhancement versions: Python 3.10 ___ Python tracker <https://bugs.python.

[issue40976] Clarify motivation for `chain.from_iterable`

2020-06-14 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +20060 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20871 ___ Python tracker <https://bugs.python.org/issu

[issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs

2020-06-18 Thread Ram Rachum
Change by Ram Rachum : -- pull_requests: +20140 pull_request: https://github.com/python/cpython/pull/20961 ___ Python tracker <https://bugs.python.org/issue40

[issue41065] Use zip-strict in zoneinfo

2020-06-21 Thread Ram Rachum
New submission from Ram Rachum : Writing the PR now. -- components: Library (Lib) messages: 371997 nosy: brandtbucher, cool-RR priority: normal severity: normal status: open title: Use zip-strict in zoneinfo type: enhancement versions: Python 3.10

[issue41065] Use zip-strict in zoneinfo

2020-06-21 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +20202 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21031 ___ Python tracker <https://bugs.python.org/issu

[issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs

2020-06-24 Thread Ram Rachum
Ram Rachum added the comment: I'll fix that typo. -- ___ Python tracker <https://bugs.python.org/issue40636> ___ ___ Python-bugs-list mailing list Unsubscr

[issue39280] Don't allow datetime parsing to accept non-Ascii digits

2020-07-17 Thread Ram Rachum
Change by Ram Rachum : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue39280> ___ ___ Pyth

[issue41457] Implement random.shuffled

2020-08-02 Thread Ram Rachum
New submission from Ram Rachum : Writing the patch now. Thread: https://mail.python.org/archives/list/python-id...@python.org/thread/OHLXVKIBMNSQO6BCFK6LEHSYNXDB6OQJ/ -- components: Library (Lib) messages: 374683 nosy: cool-RR priority: normal severity: normal status: open title

[issue41457] Implement random.shuffled

2020-08-02 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +20848 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21704 ___ Python tracker <https://bugs.python.org/issu

[issue41475] Fix mistake in "What's new in Python 3.7"

2020-08-04 Thread Ram Rachum
New submission from Ram Rachum : Writing the patch now. -- assignee: docs@python components: Documentation messages: 374814 nosy: cool-RR, docs@python priority: normal severity: normal status: open title: Fix mistake in "What's new in Python 3.7" versi

[issue41475] Fix mistake in "What's new in Python 3.7"

2020-08-04 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +20878 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21733 ___ Python tracker <https://bugs.python.org/issu

[issue41475] Fix mistake in "What's new in Python 3.7"

2020-08-04 Thread Ram Rachum
Change by Ram Rachum : -- type: -> crash versions: +Python 3.10, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue41475> ___ ___ Py

[issue41475] __future__.annotations set to become default in Python 4.0?

2020-08-04 Thread Ram Rachum
Ram Rachum added the comment: If you'd like me to patch that too, let me know. Also, I'll need a decision on whether it should be on a separate PR and if so, to which versions it should be backported. -- ___ Python track

[issue41475] __future__.annotations set to become default in Python 4.0?

2020-08-05 Thread Ram Rachum
Ram Rachum added the comment: Thanks for linking that, YoStealth. Unless I'm missing anything, it looks like there's agreement that the right answer is 3.10, and my PR fixes a spot which was omitted in the PR from the previous issu

[issue41773] Clarify handling of infinity and nan in random.choices

2020-09-12 Thread Ram Rachum
Change by Ram Rachum : -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue41773> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41773] Clarify handling of infinity and nan in random.choices

2020-09-12 Thread Ram Rachum
New submission from Ram Rachum : I was recently tripped up by a bug caused by passing infinite weights to random.choices. I toyed around with that function, and it seemed that when it's given weights that include infinity or NaN, it selects a specific element, always without being r

[issue41773] Clarify handling of infinity and nan in random.choices

2020-09-12 Thread Ram Rachum
Ram Rachum added the comment: I disagree, especially the bit about slowing down the function, since you're checking the total, not every element. Like the check for negative numbers that you do on line 493. But it's your call. --

[issue41773] Clarify handling of infinity and nan in random.choices

2020-09-13 Thread Ram Rachum
Ram Rachum added the comment: Speaking of that check, the error message is 'Total of weights must be greater than zero', which is a bit misleading. 'All weights must be positive or zero' would be more accurate. Would yo

[issue41773] Clarify handling of infinity and nan in random.choices

2020-09-13 Thread Ram Rachum
Ram Rachum added the comment: Yes, but the docs say that the weights are assumed to be nonnegative. I'm assuming the check is done on total because it'd be expensive to do it on each item. A user reading that error message could understand that it's okay for weights to be n

[issue41773] Clarify handling of infinity and nan in random.choices

2020-09-13 Thread Ram Rachum
Ram Rachum added the comment: Thanks for your time, and I accept your decision here. I'd appreciate it though if you wouldn't use the term "made up issue" on something that happened to me a couple of days ago. Our opposing positions each have their pros and cons, and

[issue41867] Include options for timespec in docstrings of isoformat

2020-09-26 Thread Ram Rachum
New submission from Ram Rachum : Writing the patch now. -- components: Library (Lib) messages: 377534 nosy: cool-RR priority: normal severity: normal status: open title: Include options for timespec in docstrings of isoformat type: enhancement versions: Python 3.10

[issue41867] Include options for timespec in docstrings of isoformat

2020-09-26 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +21455 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22418 ___ Python tracker <https://bugs.python.org/issu

[issue41773] Clarify handling of infinity and nan in random.choices

2020-09-28 Thread Ram Rachum
Ram Rachum added the comment: Sounds good, I'm on it. -- ___ Python tracker <https://bugs.python.org/issue41773> ___ ___ Python-bugs-list mailing list

[issue41773] Clarify handling of infinity and nan in random.choices

2020-09-28 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +21470 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/22441 ___ Python tracker <https://bugs.python.org/issu

[issue42391] Clarify documentation of TestCase.assertIs

2020-11-17 Thread Ram Rachum
New submission from Ram Rachum : Writing the patch now. -- assignee: docs@python components: Documentation messages: 381263 nosy: cool-RR, docs@python priority: normal severity: normal status: open title: Clarify documentation of TestCase.assertIs type: enhancement versions: Python

[issue42391] Clarify documentation of TestCase.assertIs

2020-11-17 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +22241 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23348 ___ Python tracker <https://bugs.python.org/issu

[issue14262] Allow using decimals as arguments to `timedelta`

2012-03-12 Thread Ram Rachum
New submission from Ram Rachum : Please allow using decimals as arguments to `timedelta`, so the following code won't raise an exception: Python 3.3.0a1 (default, Mar 4 2012, 17:27:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits"

[issue14262] Allow using decimals as arguments to `timedelta`

2012-03-13 Thread Ram Rachum
Ram Rachum added the comment: I'm not proposing that `timedelta` will use `Decimal` internally, but that it would handle the conversion to `float` itself, instead of the user having to do it. -- ___ Python tracker <http://bugs.py

[issue14262] Allow using decimals as arguments to `timedelta`

2012-03-13 Thread Ram Rachum
Ram Rachum added the comment: Thanks for the patch! -- ___ Python tracker <http://bugs.python.org/issue14262> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14262] Allow using decimals as arguments to `timedelta`

2012-03-20 Thread Ram Rachum
Ram Rachum added the comment: "I'm not completly conviced by the need of supporting Decimal in timedelta constructor. Why do you use Decimal if the result should be a timedelta? Why not using timedelta directly?" What do you mean, "Why not using timedelta directly?"

[issue14262] Allow using decimals as arguments to `timedelta`

2012-03-20 Thread Ram Rachum
Ram Rachum added the comment: In some cases we indeed use a timedelta directly, but sometimes we get a "number of hours", and in those cases it's more convenient for us to work with "number of hours" directly. --

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

2019-04-10 Thread Ram Rachum
Change by Ram Rachum : -- nosy: -cool-RR ___ Python tracker <https://bugs.python.org/issue22377> ___ ___ Python-bugs-list mailing list Unsubscribe:

[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

[issue34953] Implement `mmap.mmap.__repr__`

2018-10-10 Thread Ram Rachum
Change by Ram Rachum : -- components: Library (Lib) nosy: cool-RR priority: normal severity: normal status: open title: Implement `mmap.mmap.__repr__` type: enhancement versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue34

[issue34953] Implement `mmap.mmap.__repr__`

2018-10-10 Thread Ram Rachum
Ram Rachum added the comment: There are a few ways we can go with this, depending on how verbose we want to be and how willing we are to make calls to the data. Here are a few pieces of information we could expose: - Length - Whether it's a file or anonymous memory - The entire con

[issue34953] Implement `mmap.mmap.__repr__`

2018-10-15 Thread Ram Rachum
Ram Rachum added the comment: thautwarm, your suggestions look good. I'm not sure why you used `entire_contents`, do you want to show the entire content there? Because I saw that the sample you used had truncation. It might be unsafe to show the entire mmap, because it could be huge

[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.) Wh

[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 <http://bugs.python.org/issue18212> ___ ___ Python-bugs-list m

[issue3177] Add shutil.open

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

[issue8289] multiprocessing.Process.__init__ pickles all arguments

2012-06-11 Thread Ram Rachum
Ram Rachum added the comment: I opened this issue 2 years ago, and I don't remember it being easily solvable back then. But I've long forgotten what the problems were, and I've lost personal interest in it, so I guess we'll just let it go. -- sta

[issue15975] Allow multiplying timedelta by Decimal

2012-09-19 Thread Ram Rachum
New submission from Ram Rachum: Please allow multiplying timedelta by a Decimal: Python 3.3.0a1 (default, Mar 4 2012, 17:27:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information

[issue15975] Allow multiplying timedelta by Decimal

2012-09-19 Thread Ram Rachum
Ram Rachum added the comment: This is for cases where I already have the number as a Decimal. Asking me to convert it to `float` myself is annoying. -- ___ Python tracker <http://bugs.python.org/issue15

[issue15975] Allow multiplying timedelta by Decimal

2012-09-19 Thread Ram Rachum
Ram Rachum added the comment: +1 on folding this into issue 14262. -- ___ Python tracker <http://bugs.python.org/issue15975> ___ ___ Python-bugs-list mailin

[issue14262] Allow using decimals as arguments to `timedelta`

2012-09-19 Thread Ram Rachum
Ram Rachum added the comment: @mark.dickinson: Many different sources. One example is decimal fields on Django, used for dollar amounts. -- ___ Python tracker <http://bugs.python.org/issue14

[issue14262] Allow using decimals as arguments to `timedelta`

2012-09-19 Thread Ram Rachum
Ram Rachum added the comment: I hope this was intended as a joke. If this was an actual criticism, let me know so I could explain why it makes sense. -- ___ Python tracker <http://bugs.python.org/issue14

[issue14262] Allow using decimals as arguments to `timedelta`

2012-09-19 Thread Ram Rachum
Ram Rachum added the comment: I can think of millions of use cases. Here's a random one out of those millions: A client is entitled to X hours of service a month. We grant him a promotion where he is allowed 15% more than x, i.e. 1.15*x. But that number, 1.15, is stored in a Django de

[issue14262] Allow using decimals as arguments to `timedelta`

2012-09-19 Thread Ram Rachum
Ram Rachum added the comment: In the example I gave, Decimal is clearly preferred over float. Why would we use float to represent the ratio of the bonus to the client? Why would we risk imprecision there when Decimal provides us with perfect precision

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

2014-03-17 Thread Ram Rachum
Changes by Ram Rachum : -- title: Add `pathlib.Path.write` and `pathlib.Path.read` -> Add methods to `pathlib.Path`: `write_text`, `read_text`, `write_bytes`, `read_bytes` ___ Python tracker <http://bugs.python.org/issu

[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() i

[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

[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

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

<    1   2   3   4   >