[issue45606] pathlib.Path.glob() does not list dangling symlink when pattern is the exact filenane

2021-10-25 Thread Rasmus Bondesson
New submission from Rasmus Bondesson : Create a symlink that points to file that doesn't exist: ln -s /nonexisting_file my_symlink Then try to glob for that symlink from Python using pathlib: python3 >>> import pathlib >>> list(pathlib.Path(&qu

[issue29019] dict.fromkeys overallocates when given a sparse dict

2016-12-19 Thread Rasmus Villemoes
New submission from Rasmus Villemoes: Somewhat related to #23971, but with the opposite sign: Using Py_SIZE on a PyDictObject gives the ma_fill member in 2.7 (and until 3.2 AFAICT), not the ma_used member. So calling dict.fromkeys(d) overallocates significantly if a lot of elements have been

[issue28607] C implementation of parts of copy.deepcopy

2016-11-08 Thread Rasmus Villemoes
Rasmus Villemoes added the comment: New version, addressing (hopefully) all review comments. -- Added file: http://bugs.python.org/file45400/deepcopy.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue28607] C implementation of parts of copy.deepcopy

2016-11-03 Thread Rasmus Villemoes
New submission from Rasmus Villemoes: This is mostly an RFC patch. It compiles and passes the test suite. A somewhat silly microbenchmark such as ./python -m timeit -s 'import copy; x = dict([(str(x), x) for x in range(1)]);' 'copy.deepcopy(x)' runs about 30x faster. In the (2.7 only

[issue26222] Missing code in linux_distribution python 2.7.11

2016-01-27 Thread Rasmus Rynning Rasmussen
New submission from Rasmus Rynning Rasmussen: During the transition from python 2.7.10 to 2.7.11 some code seems to have been lost. platform.linux_distribution() is not able to recognise Debian based distributions in python 2.7.11. The following code was present in platform.py, python 2.7.10

[issue12559] gzip.open() needs an optional encoding argument

2011-11-25 Thread Rasmus Ory Nielsen
Changes by Rasmus Ory Nielsen r...@ron.dk: -- nosy: +rasmusory ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12559 ___ ___ Python-bugs-list

ANN: SUMMON 1.8.8 Released: 2D Visualization prototyping and scripting

2009-07-08 Thread rasmus
, Windows, OS/X) * And lots of examples for how to prototype your own custom 2D visualizations Web site and download: http://people.csail.mit.edu/rasmus/summon/ Videos: http://people.csail.mit.edu/rasmus/summon/index.shtml#videos -- http://mail.python.org/mailman/listinfo/python-announce

ANN: KeepNote 0.5.3 - Note taking and organization

2009-07-08 Thread rasmus
KeepNote is a simple cross-platform note taking program implemented in Python. I have been using it for my research and class notes, but it should be applicable to many note taking situations. KeepNote is ideal for storing your class notes, TODO lists, research notes, journal entries, paper

SUMMON 1.8.7 Released: 2D Visualization prototyping and scripting

2009-05-28 Thread rasmus
, Windows, OS/X) * And lots of examples for how to prototype your own custom 2D visualizations Web site and download: http://people.csail.mit.edu/rasmus/summon/ -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http

ANN: KeepNote 0.5.2 - Note taking and organization

2009-04-13 Thread rasmus
KeepNote is a simple cross-platform note taking program implemented in Python. I have been using it for my research and class notes, but it should be applicable to many note taking situations. KeepNote is ideal for storing your class notes, TODO lists, research notes, journal entries, paper

[issue5280] PyBytes_InternInPlace is missing in bytesobject.h

2009-02-16 Thread Rasmus Andersson
Changes by Rasmus Andersson ras...@flajm.com: -- type: - compile error ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5280 ___ ___ Python-bugs

[issue5280] PyBytes_InternInPlace is missing in bytesobject.h

2009-02-16 Thread Rasmus Andersson
New submission from Rasmus Andersson ras...@flajm.com: The PyBytes_InternInPlace 2-to-3 transition macro is missing in include/bytesobject.h Alternatively, the documentation[1] is missing some details. At the top there's a note saying These functions have been renamed to PyBytes_* in Python

ANN: KeepNote 0.5.1 - Note taking and organization

2009-01-29 Thread rasmus
KeepNote is a simple cross-platform note taking program implemented in Python. I have been using it for my research and class notes, but it should be applicable to many note taking situations. KeepNote is ideal for storing your class notes, TODO lists, research notes, journal entries, paper

ANN: TakeNote 0.4.5 - Note taking and organization

2008-12-29 Thread rasmus
TakeNote is a simple cross-platform note taking program implemented in Python. I have been using it for my research and class notes, but it should be applicable to many note taking situations. TakeNote is ideal for storing your class notes, TODO lists, research notes, journal entries, paper

Re: Rich Comparisons Gotcha

2008-12-10 Thread Rasmus Fogh
. Rasmus H. Fogh Email: [EMAIL PROTECTED] Dept. of Biochemistry, University of Cambridge, 80 Tennis Court Road, Cambridge CB2 1GA, UK. FAX (01223)766002 -- http://mail.python.org/mailman/listinfo/python-list

Re: Rich Comparisons Gotcha

2008-12-10 Thread Rasmus Fogh
Rhodri James wrote: On Mon, 08 Dec 2008 14:24:59 -, Rasmus Fogh wrote: On the minus side there would be the difference between '__equal__' and '__eq__' to confuse people. This is a very big minus. It would be far better to spell __equal__ in such a way as to make it clear why

Re: Rich Comparisons Gotcha

2008-12-09 Thread Rasmus Fogh
Steven DAprano wrote: On Mon, 08 Dec 2008 14:24:59 +, Rasmus Fogh wrote: For my personal problem I could indeed wrap all objects in a wrapper with whatever 'correct' behaviour I want (thanks, TJR). It does seem a bit much, though, just to get code like this to work as intended

Re: Rich Comparisons Gotcha

2008-12-09 Thread Rasmus Fogh
Steven DAprano wrote: On Mon, 08 Dec 2008 14:24:59 +, Rasmus Fogh wrote: snip What might be a sensible behaviour (unlike your proposed wrapper) Sorry 1) I was rude, 2) I thanked TJR for your wrapper class proposal in a later mail. It is yours. What do you dislike about my wrapper class

Re: Rich Comparisons Gotcha

2008-12-09 Thread Rasmus Fogh
Mark Dickinson wrote: On Dec 8, 2:24 pm, Rasmus Fogh [EMAIL PROTECTED] wrote: So, I would much prefer a language change. I am not competent to even propose one properly, but I'll try. I don't see any technical problems in what you propose: as far as I can see it's entirely feasible

Re: Rich Comparisons Gotcha

2008-12-08 Thread Rasmus Fogh
Rober Kern wrote: James Stroud wrote: Steven D'Aprano wrote: On Sun, 07 Dec 2008 13:57:54 -0800, James Stroud wrote: Rasmus Fogh wrote: ll1 = [y,1] y in ll1 True ll2 = [1,y] y in ll2 Traceback (most recent call last): File stdin, line 1, in module ValueError: The truth value

Re: Rich Comparisons Gotcha

2008-12-07 Thread Rasmus Fogh
Robert Kern Wrote: Terry Reedy wrote: Rasmus Fogh wrote: Personally I would like to get these [EMAIL PROTECTED]* misfeatures removed, What you are calling a misfeature is an absence, not a presence that can be removed. That's not quite true. Rich comparisons explicitly allow non-boolean

Re: Rich Comparisons Gotcha

2008-12-07 Thread Rasmus Fogh
Jamed Stroud Wrote: Rasmus Fogh wrote: Dear All, For the first time I have come across a Python feature that seems completely wrong. After the introduction of rich comparisons, equality comparison does not have to return a truth value, and may indeed return nothing at all and throw an error

Re: Rich Comparisons Gotcha

2008-12-07 Thread Rasmus Fogh
On Sun, 07 Dec 2008 13:03:43 +, Rasmus Fogh wrote: Jamed Stroud Wrote: ... Second, consider that any value in python also evaluates to a truth value in boolean context. But bool(x) can fail too. So not every object in Python can be interpreted as a truth value. Third, every function

Rich Comparisons Gotcha

2008-12-06 Thread Rasmus Fogh
, can I somehow work around the fact that if foo == bar: or foo in alist does not work for arbitrary objects? Yours, Rasmus Some details: CCPN has a table display class that maintains a list of arbitrary objects, one per line in the table. The table class is completely generic, and subclassed

ANN: TakeNote 0.4.2 - Note taking and organization

2008-09-27 Thread rasmus
TakeNote 0.4.2 - Note taking and organization In this release: * faster loading * bullet point lists * more customization * bug fixes TakeNote is a simple cross-platform note taking program implemented in Python. I have been using it for my research and class notes, but it should be

ANN: TakeNote 0.4.1 - Note taking and organization

2008-08-11 Thread rasmus
This release contains - several bug fixes - better support for HTML and image copy and paste - customizable word-wrap TakeNote is a simple cross-platform note taking program implemented in Python. I have been using it for my research and class notes, but it should be applicable to many note

Re: Plotting 3d points

2008-02-11 Thread Rasmus Kjeldsen
search yields nothing useable. Rasmus Kjeldsen -- http://mail.python.org/mailman/listinfo/python-list

Plotting 3d points

2008-02-10 Thread Rasmus Kjeldsen
of mlab to make any sense (the importing the module part, that is!). Rasmus Kjedlsen -- http://mail.python.org/mailman/listinfo/python-list

ANN: SUMMON 1.8.5 Released: 2D Visualization prototyping and scripting

2008-02-04 Thread rasmus
, Windows, OS/X) * And lots of examples for how to prototype your own custom 2D visualizations Web site and download: http://people.csail.mit.edu/rasmus/summon/ -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http

Re: opposite of zip()?

2007-12-15 Thread rasmus
On Dec 15, 4:45 am, Gary Herron [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hi folks, Thanks, for all the help. I tried running the various options, and here is what I found: from array import array from time import time def f1(recs, cols): for r in recs: for

Re: GLE-like python package

2007-10-15 Thread rasmus
willing to bite that bullet. Thanks :) /W In case you're interested in making interactive visualizations, you might want to look at my own python package SUMMON: http://people.csail.mit.edu/rasmus/summon/index.shtml Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I get the current path of my python file that is currently running.

2007-08-23 Thread rasmus
On Aug 23, 3:33 am, Arnau Sanchez [EMAIL PROTECTED] wrote: Lamonte Harris escribió: Say I start i click on a python file on my desktop, how could I return the path of the current python file thats running? http://docs.python.org/lib/module-sys.html Try this: import sys import os print

profiling a C++ python extension

2007-07-10 Thread rasmus
I have used gprof to profile stand alone C++ programs. I am also aware of pure python profilers. However, is there a way to get profile information on my C++ functions when they are compiled in a shared library (python extension module) and called from python. From what I can tell, gmon.out

SUMMON - Rapid prototyping of 2D visualizations

2007-04-05 Thread matt . rasmus
these features in an extension module for python called SUMMON which I have made freely available on my website for anyone who is interested http://people.csail.mit.edu/ rasmus/summon/index.shtml. Although, there are many visualization frameworks, I believe SUMMON provides a fairly unique