New submission from Ram Rachum :
The `msg` argument to the `assertRaises` function isn't documented. The
documentation should say what this argument does.
--
assignee: docs@python
components: Documentation
messages: 408587
nosy: cool-RR, docs@python
priority: normal
severity: n
Ram Rachum added the comment:
Thanks, but people looking at a specific function might not guess that the
documentation for one of its arguments is hiding somewhere on the long page.
This is especially relevant with a confusing argument like `msg`, since it's
tempting to think that
Ram Rachum added the comment:
I'd include that same message you quoted, minus the list of functions, on each
and every one of the functions that have this argument.
--
___
Python tracker
<https://bugs.python.org/is
Ram Rachum added the comment:
I disagree but I guess I'm in the minority here, so I'll close this issue.
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.py
Ram Rachum added the comment:
Oh that sucks. Logan and Antoine worked on this feature for so long. Thanks for
reporting Greg.
--
___
Python tracker
<https://bugs.python.org/issue44
New submission from Ram Rachum :
Look here:
http://hg.python.org/cpython/file/3313ce92cef7/Lib/smtplib.py#l279
`port` and `host` are confused.
I saw this is fixed on 3.2; possibly it should be fixed in the next 2.7 micro
release too.
--
components: Library (Lib)
messages: 145442
Ram Rachum added the comment:
The reason this bug bothered me is because I was debugging a Django app, and in
the stacktrace's local variables I suddenly saw that `host` was `25`, which
seemed like a bug to me and wasted me 5 minutes. So it's not a critical bug but
it wast
New submission from Ram Rachum :
Recently I was confronted with a mysterious error:
ImportError: No module named datetime
Firther investigation revealed that the cause was a pickling problem that ran
`__import__('datetime\r')`.
If `ImportError` would have shown the module
Changes by Ram Rachum :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue13457>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Ram Rachum :
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue13457>
___
___
Python-bugs-list mailing list
Unsubscri
New submission from Ram Rachum :
The `rot_13` codec is supposed to work like this, no?
>>> 'qwerty'.encode('utf-8')
b'qwerty'
>>> 'qwerty'.encode('rot_13')
Traceback (most recent call last):
File "", line 1, in
Ram Rachum added the comment:
Then I suggest replacing this error message:
encoder did not return a bytes object (type=str)
and this one:
'memoryview' object has no attribute 'translate'
With something like:
Please use `codecs.lookup('rot-13'
Ram Rachum added the comment:
Why is this still marked as "test needed"?
--
___
Python tracker
<http://bugs.python.org/issue11969>
___
___
Python-bugs-l
Ram Rachum added the comment:
Diff attached, is it good? I'm not very experienced with diffs, I usually work
with pull requests.
--
keywords: +patch
Added file: http://bugs.python.org/file22144/patch.diff
___
Python tracker
<http://bugs.py
Changes by Ram Rachum :
Removed file: http://bugs.python.org/file22144/patch.diff
___
Python tracker
<http://bugs.python.org/issue11969>
___
___
Python-bugs-list mailin
Changes by Ram Rachum :
Removed file: http://bugs.python.org/file22027/test.py
___
Python tracker
<http://bugs.python.org/issue11969>
___
___
Python-bugs-list mailin
Ram Rachum added the comment:
Thanks for the `-u` tip and the correction to the code, Petri. I removed my
previous files since yours is the definite one. And yeah, it's a Windows issue.
--
___
Python tracker
<http://bugs.python.org/is
New submission from Ram Rachum :
I noticed that in MSI installers downloaded from PyPI don't have an accelerator
on the Finish button. Please add an accelerator on it. (I think that "F" is the
accepted one.)
--
assignee: tarek
components: Distutils
messages: 13946
Ram Rachum added the comment:
I can only do wxPython, I have no idea how Python's MSI installers work. I did
a quick search for "Finish" in the codebase but could find any obvious place to
add the accelerator.
"As a new feature, this cannot go into distuti
New submission from Ram Rachum :
I want to use `os.startfile` to open a folder in Explorer/Nautilus/Finder. The
documentation says that it's only implemented on Windows:
http://docs.python.org/dev/library/os.html#os.startfile
See discussion on Python-ideas here:
https://groups.googl
Changes by Ram Rachum :
--
nosy: +cool-RR
___
Python tracker
<http://bugs.python.org/issue3177>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Ram Rachum :
Is there a good reason that `issubclass(collections.deque,
collections.Sequence) == False`? What's not-sequence-y about `deque`?
--
messages: 140206
nosy: cool-RR
priority: normal
severity: normal
status: open
title: `issubclass(collections.
Ram Rachum added the comment:
Eric, I have no problem with this function being placed in `shutil` instead of
`os`, as long as it's implemented and it's in the standard library, and people
don't have to use subprocess to run open or xdg-open themselves as I currently
do.
So I
New submission from Ram Rachum :
I've been frustrated so many times by `ImportError: cannot import name foo`.
Right now I'm debugging some problem on a PAAS server (with no SSH access), and
the server returns a traceback of `cannot import name foo`, and I don't have
any idea wh
Ram Rachum added the comment:
As long as those attributes are reflected in the string in human language, why
not.
--
___
Python tracker
<http://bugs.python.org/issue12
Ram Rachum added the comment:
What's the problem with detecting circular imports? Mind you that we only need
a post-mortem analysis to check why the import failed; so after the import
failed, we could check whether our import stack has a loop in it.
I'm not familiar with the Imp
Ram Rachum added the comment:
Brett: Why does it matter that it will be costly? It's a post-mortem activity
anyway, usually done when something critical failed and the entire system isn't
working.
Why would functions need to be looked at? I mean, isn't a circular import w
Ram Rachum added the comment:
Brett, I checked out the two pieces of documentation you referred to, they have
very little information about ImportWarning other than "Base class for warnings
about probable mistakes in module imports."
--
Ram Rachum added the comment:
David, I don't think you've read my message carefully enough. I'm well aware
that there are other ways in Python to import than the `import` statement. I'm
proposing that it doesn't matter.
I asked, "isn't a circular import w
Ram Rachum added the comment:
Thanks for explaining, I guess it's too complicated.
--
___
Python tracker
<http://bugs.python.org/issue12583>
___
___
Pytho
New submission from Ram Rachum :
I was installing Python 3.2.1 on my laptop today, and was unable to efficiently
use the keyboard in order to navigate the installation dialogs. Every button
should have an accelerator, e.g. "Next" should be "&Next" so Alt-N will press
i
New submission from Ram Rachum :
Currently, when you use an MSI installer (and possibly also EXE) for a Python
module, it automatically detects the location of your various system's Python
installations. This is very convenient.
However, this can be a problem sometimes, if your P
Ram Rachum added the comment:
Martin, what do you mean "administrative installation"?
--
___
Python tracker
<http://bugs.python.org/issue12895>
___
___
New submission from Ram Rachum :
OrderedDict is currently comparable to dict.
I think this is not logical, because a dict doesn't have order, and having an
identical order is a necessary condition for a match.
I think that comparing an OrderedDict with a dict makes as much sense as
comp
Ram Rachum added the comment:
Thanks Benjamin. Was there a discussion about this in the mailing list? If so
can you give me a link to it?
--
___
Python tracker
<http://bugs.python.org/issue9
New submission from Ram Rachum :
Let's say you have this structure:
a\
__init__.py
b\
__init__.py
In `b.__init__` a function called `my_function` is defined.
And assume that `a` and `b` are both on `sys.path`. Then this situation happens:
>>> import a.b
Ram Rachum added the comment:
Benjamin,
This behavior is involved in a problem I have with Django. When using Django,
you have apps that live inside a project:
my_project\
__init__.py
my_app\
__init__.py
views.py
So if you have a view function in `views.py`, it will have two
New submission from Ram Rachum :
The `cProfile.runctx` function currently doesn't allow using the `sort`
argument. For some reason the `sort` argument is allowed in `run` but not in
`runctx`. Attached is a patch that allows using `sort` in `runctx`.
--
components: Library (Lib)
Ram Rachum added the comment:
Is this going into 3.2?
--
___
Python tracker
<http://bugs.python.org/issue9898>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Ram Rachum :
Is there a reason why `execpt` compares base classes instead of using
`isinstance`? This prevents using `__instancecheck__` to override the instance
check.
--
components: Interpreter Core
messages: 117844
nosy: cool-RR
priority: normal
severity: normal
Ram Rachum added the comment:
I don't understand the infinite recursion argument. If there's such an infinite
recursion, wouldn't it be due to a bug in the user's implementation of
__instancecheck__?
--
___
Python tracker
<
Ram Rachum added the comment:
Also, how important is the performance of exception checking *after* an
exception was raised? I mean, wouldn't it matter only for programs that raise
and catch hundreds of exceptions a second?
--
___
Python tr
Changes by Ram Rachum :
--
versions: +Python 3.3 -Python 3.2
___
Python tracker
<http://bugs.python.org/issue8289>
___
___
Python-bugs-list mailing list
Unsub
Ram Rachum added the comment:
I also miss being able to pickle unbound methods on Python 3. I don't think
there's an interest in pickling the actual code objects. In my opinion, unbound
methods should be pickled exactly like all the other Python definitions, such
as bound methods,
Changes by Ram Rachum :
--
versions: +Python 3.3 -Python 3.2
___
Python tracker
<http://bugs.python.org/issue9276>
___
___
Python-bugs-list mailing list
Unsub
New submission from Ram Rachum :
Please allow to deepcopy and to pickle paused generators, including all their
state.
This is implemented in Pypy:
Python 2.5.2 (335e875cb0fe, Dec 28 2010, 20:31:56)
[PyPy 1.4.1] on win32
Type "copyright", "credits"
Ram Rachum added the comment:
P.S. I'm willing to write a test-case if it will help.
--
___
Python tracker
<http://bugs.python.org/issue11299>
___
___
Pytho
Ram Rachum added the comment:
Tests attached.
--
Added file: http://bugs.python.org/file20898/test_live_generator.py
___
Python tracker
<http://bugs.python.org/issue11
Ram Rachum added the comment:
Hi Alexandre,
I read your blog post, but I don't understand-- Why does bytecode need to be
pickled in order to pickle live generators? I understand that the local
variables need to be pickled, (and let's assume they're all pickleable,) and
that a
Ram Rachum added the comment:
*"generator objects do not have names we can refer to"*
How about referring to the generator function that created them and to all the
arguments?
Regarding instruction pointer, I really don't know the internals of how this
works. Can we make some
Changes by Ram Rachum :
--
nosy: +cool-RR
___
Python tracker
<http://bugs.python.org/issue11356>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ram Rachum :
--
nosy: +cool-RR
___
Python tracker
<http://bugs.python.org/issue1559549>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ram Rachum added the comment:
Okay, as an initial suggestion, how about we give every function a
`.__parent_class__` attribute saying which class it is a method of? I feel this
is a bit of a duct tape solution, but I don't see any other altern
Ram Rachum added the comment:
Raymond: I don't think this matters. We don't need a canonical
`.__parent_class__`, we just need to know where that function is defined so we
could find it when unpickling. In the example that you gave, `f` would have a
`.__parent_class__` of `Non
Ram Rachum added the comment:
> This isn't worth introducing poorly thought out hacks.
Being able to pickle unbound methods is important. In my project I have objects
that refer to unbound methods. Now these objects are unpickleable. I can't save
them to disk and I
Ram Rachum added the comment:
> [...] try to whip up a patch and upload it if it ends up not too hackish.
To have a non-hackish patch we need a non-hackish idea. The `.__parent_class__`
idea looks hackish to me, but now that I think about it, how is it more hackish
than a functio
Ram Rachum added the comment:
Amaury: I don't think ForkingPickler works for unbound methods defined in user
code, which are implemented as functions. I think it only works for
method-descriptors and wrapper-descriptors.
--
___
Python tr
Ram Rachum added the comment:
Amaury:
Your example succeeds on Linux but fails on Windows:
$ python3.2 main.py
CALLED
Traceback (most recent call last):
File "C:\Python32\Lib\pickle.py", line 679, in save_global
klass = getattr
Ram Rachum added the comment:
I don't have the time and the ability to write the patch that implements this.
I'll be happy to write tests if you think this will help.
--
___
Python tracker
<http://bugs.python.
New submission from Ram Rachum :
I suggest a `Counter.elements_count()` method should be added, that would give
the same answer as `sum(counter.itervalues())`.
--
components: Library (Lib)
messages: 132708
nosy: cool-RR, rhettinger
priority: normal
severity: normal
status: open
type
New submission from Ram Rachum :
bool(Counter({'a': 0'})) is True.
Is this wise? I want to be able to do:
if my_counter:
whatever
To check whether my counter has any elements. Currently this seems to be
impossible because of this bug.
Will we have to keep this
Changes by Ram Rachum :
--
title: `bool(Counter({'a': 0'})) is True` -> `bool(Counter({'a': 0})) is True`
___
Python tracker
<ht
Ram Rachum added the comment:
Before coding a test I want to know whether we can even make this change with
regards to backwards compatibility.
--
___
Python tracker
<http://bugs.python.org/issue11
Ram Rachum added the comment:
Hmm... So how about making `elements` a smart object which will implement
`__bool__`? Then we could give it a `__len__` too and be rid of issue11733.
--
___
Python tracker
<http://bugs.python.org/issue11
Ram Rachum added the comment:
How is it "not the Python way"? Why is it okay to make `dict.keys` into a smart
object but it's not okay to make `Counter.elements` a smart object?
These are not random ideas. I'm using `Counter` in a contract project and I
find the need
New submission from Ram Rachum :
In the documentation for `itertools.islice` I see this line:
it = iter(xrange(s.start or 0, s.stop or sys.maxint, s.step or 1))
Is it really okay to do `s.stop or sys.maxint`? I'm assuming this was targeting
`None`, but what if `s.stop == 0`? And `s
Ram Rachum added the comment:
I was bitten now as well...
--
nosy: +cool-RR
___
Python tracker
<http://bugs.python.org/issue8400>
___
___
Python-bugs-list mailin
New submission from Ram Rachum :
Hello,
I found this bit in my inbox, I forgot why I cared about it, but it raises an
exception (at least on Windows):
>>> import multiprocessing
>>> p = multiprocessing.Process(target=bytes.maketrans, args=(b'abc', b'xyz')
Ram Rachum added the comment:
Test attached.
--
Added file: http://bugs.python.org/file22027/test.py
___
Python tracker
<http://bugs.python.org/issue11
New submission from Ram Rachum :
When you create an `abc.abstractproperty` on a class, any subclass must
override it as an actual property in order to be instantiable. But sometimes
you want to override it with a data attribute instead, i.e. `self.x = 5`
instead of `x = property(...)`. It
Ram Rachum added the comment:
Daniel, the behavior you describe is already present in Python 3.2.
--
___
Python tracker
<http://bugs.python.org/issue12
Ram Rachum added the comment:
Eric, do you think that a solution can be made by calling `__init__` inside of
`ABCMeta.__new__` and then afterwards checking the instance for attributes?
--
___
Python tracker
<http://bugs.python.org/issue12
Ram Rachum added the comment:
Ah, I got confused, there's no way we can call `__init__` in `ABCMeta.__new__`.
--
___
Python tracker
<http://bugs.python.org/is
New submission from Ram Rachum :
>>> import abc
>>> class A(object, metaclass=abc.ABCMeta):
... pass
>>> issubclass([], A)
Traceback (most recent call last):
File "", line 1, in
issubclass([], A)
File "c:\Python32\lib\abc.py", line 1
Ram Rachum added the comment:
But do you think it's a good idea that `issubclass(1, list)` raises an
exception? Why not simply return `False`?
Do you think there's someone out there who's counting on `issubclass` to raise
an exception?
--
status:
Ram Rachum added the comment:
Amaury, I am aware of what `issubclass` does and what `isinstance` does. I am
not manually feeding `[]` into `issubclass`. I have an object which can be
either a list, or a string, or a callable, or a type. And I want to check
whether it's a sub-class of
New submission from Ram Rachum :
The Python documentation uses :func:`staticmethod` to describe staticmethod,
while staticmethod is a type.
I want to link to the Python documentation from my project's documentation
using Intersphinx, and I wouldn't want to mislead my users by mark
Ram Rachum added the comment:
But why? What's the reason for that? Why mislabel a type as a function?
--
___
Python tracker
<http://bugs.python.org/is
Ram Rachum added the comment:
I'm really confused by your comment.
"int being a function is really a CPython implementation detail"
I don't understand this. I should be able to do isinstance(x, int) in all
implementations of Python, no? So `int` must be a cla
Ram Rachum added the comment:
So if int is officially a class, why not start doing :class:`int` instead of
:func:`int`?
"they’re marked up as functions, so you should treat them as functions."
Here, I've treated staticmethod as a function:
>>> assert
Changes by Ram Rachum :
--
nosy: +cool-RR
___
Python tracker
<http://bugs.python.org/issue7946>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Ram Rachum :
Currently, when you create a Process, all arguments you pass to its __init__
get pickled. I understood this is done because arguments to __init__ almost
always become attributes to the Process. Like this:
def MyProcess(multiprocessing.Process):
def
Ram Rachum added the comment:
Sorry, I accidentally typed "def" instead of "class" in my code sample.
--
___
Python tracker
<http://bu
Change by Ram Rachum :
--
assignee: docs@python
components: Documentation
nosy: cool-RR, docs@python
priority: normal
pull_requests: 15149
severity: normal
status: open
title: Mention ``frame.f_trace`` in :func:`sys.settrace` docs.
type: enhancement
versions: Python 3.9
Ram Rachum added the comment:
Serhiy: I confirmed what you're saying and corrected the documentation. Could
you please review?
--
___
Python tracker
<https://bugs.python.org/is
New submission from Ram Rachum :
I'm writing a PR for this right now.
--
components: Library (Lib)
messages: 354279
nosy: cool-RR
priority: normal
severity: normal
status: open
title: Clarify docstrings of pathlib suffix(es)
versions: Pytho
Change by Ram Rachum :
--
keywords: +patch
pull_requests: +16264
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16679
___
Python tracker
<https://bugs.python.org/issu
New submission from Ram Rachum :
I was working with a Popen object recently in the shell and it was annoying to
see the `` display. It would be nice to get some
kind of minimal detail about the Popen, for example its args and return code,
if finished.
--
components: Library (Lib
Change by Ram Rachum :
--
nosy: +taleinat
___
Python tracker
<https://bugs.python.org/issue38724>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Ram Rachum :
I love `concurrent.futures`, and I'd like to use it wherever I can. There's a
feature in `multiprocessing.Pool` that I wish would also be available in
`ProcessPoolExecutor`: The `maxtasksperchild` argument.
Documentation: "maxtasksperchild i
Ram Rachum added the comment:
Awesome. You can link to experimental code here. Even if it were not accepted
to Python, it could be useful for me and for other people who might see this
issue.
--
___
Python tracker
<https://bugs.python.
Ram Rachum added the comment:
I confirmed now in the 3.10 installer on Windows that accelerators are working.
Thank you!
--
resolution: out of date -> fixed
___
Python tracker
<https://bugs.python.org/issu
Ram Rachum added the comment:
Interesting feature Irit, thank you
Two things:
1. Is there better documentation for that feature than what was in the CL of
the issue you linked to? Because that documentation was more lawyery than
explanatory.
2. If I understand correctly, the note is
Ram Rachum added the comment:
This might work here, but you'd need to be sure there isn't any important code
that looks at the IncompleteRead exception and expects the data to be in its
message.
Also I hope that various tools like IDEs would learn quickly that they need to
displa
Ram Rachum added the comment:
Okay, works for me.
--
___
Python tracker
<https://bugs.python.org/issue28953>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Ram Rachum :
The new __note__ feature for exception could be useful, but the documentation
(and the section in "What's new") aren't good enough:
"__note__: A mutable field which is :const:`None` by default and can be set to
a string. If it is
New submission from Ram Rachum :
I recently got this familiar error:
builtins.TypeError: __init__() takes 1 positional argument but 2 were given
It was annoying that I didn't know which `__init__` method was under
discussion. I wish that Python used the `__qualname__` of the functi
Ram Rachum added the comment:
Here is a short IPython session:
In [1]: class Foo:
...: def __init__(self, x):
...: pass
Ram Rachum added the comment:
> But I *did* get that text. I'm asking how you got the *different* text
> which you gave in your initial request.
Oh, right. Looking back, turns out Wing IDE did that for me. Didn't notice,
sorry.
> So in my opinion, and I recognise th
New submission from Ram Rachum :
The platform.py module takes non-Ascii digits in regexes in places it
shouldn't. e.g. digits like ٢ and 5 and accepted, when only the Ascii digits
between 0-9 should be accepted.
--
components: Library (Lib)
messages: 359694
nosy: cool-RR
pri
1 - 100 of 398 matches
Mail list logo