[issue33827] Generators with lru_cache can be non-intuituve

2018-06-11 Thread Michel Albert
New submission from Michel Albert : Consider the following code: # filename: foo.py from functools import lru_cache @lru_cache(10) def bar(): yield 10 yield 20 yield 30 # This loop will work as expected for row in bar(): print(row

[issue20825] containment test for "ip_network in ip_network"

2016-09-13 Thread Michel Albert
Michel Albert added the comment: Are there any updates on this? Not sure if it's too late again to get it applied for the next Python (3.6) release? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue20825] containment test for "ip_network in ip_network"

2016-06-25 Thread Michel Albert
Michel Albert added the comment: New patch with proposed changes. -- Added file: http://bugs.python.org/file43537/net-in-net-r6.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue20825] containment test for "ip_network in ip_network"

2016-06-25 Thread Michel Albert
Michel Albert added the comment: Updated patch, taking into account notes from the previous patch-reviews -- Added file: http://bugs.python.org/file43535/net-in-net-r5.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue20825] containment test for "ip_network in ip_network"

2016-06-25 Thread Michel Albert
Michel Albert added the comment: Test pass properly. Is there anything else left to do? Here's the fixed patch (net-in-net-r4.patch) -- Added file: http://bugs.python.org/file43534/net-in-net-r4.patch ___ Python tracker <rep...@bugs.python.

[issue20825] containment test for "ip_network in ip_network"

2016-06-25 Thread Michel Albert
Michel Albert added the comment: I just realised that the latest patch on this no longer applies properly. I have fixed the issue and I am currently in the process of running the unit-tests which takes a while. Once those pass, I'll update some metadata and resubmit

[issue20815] ipaddress unit tests PEP8

2014-03-23 Thread Michel Albert
Michel Albert added the comment: It seems the contributor agreement form has been processed. As I understand it, the asterisk on my name confirms this. I also verified that this patch cleanly applies to the most recent revision. -- ___ Python

[issue20825] containment test for ip_network in ip_network

2014-03-23 Thread Michel Albert
Michel Albert added the comment: Hi again, The contribution agreement has been processed, and the patch still cleanly applies to the latest revision of branch `default`. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20825

[issue20826] Faster implementation to collapse consecutive ip-networks

2014-03-23 Thread Michel Albert
Michel Albert added the comment: Sorry for the late reply. I wanted to take some time and give a more detailed explanation. At least to the best of my abilities :) I attached a zip-file with my quick-and-dirty test-rig. The zip contains: * gendata.py -- The script I used to generate test

[issue20825] containment test for ip_network in ip_network

2014-03-23 Thread Michel Albert
Michel Albert added the comment: I made the changes mentioned by r.david.murray I am not sure if the modifications in ``Doc/whatsnew/3.5.rst`` are correct. I tried to follow the notes at the top of the file, but it's not clear to me if it should have gone into ``News/Misc`` or into ``Doc

[issue20815] ipaddress unit tests PEP8

2014-03-12 Thread Michel Albert
Michel Albert added the comment: Did so already last weekend. I suppose it will take some time to be processed. I can ping you via a message here once I receive the confirmation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue20825] containment test for ip_network in ip_network

2014-03-11 Thread Michel Albert
Michel Albert added the comment: Yes. I signed it last Friday if I recall correctly. As I understood it, the way for you to tell if it's done, is that my username will be followed by an asterisk. But I'm not in a hurry. Once I get the confirmation, I can just ping you again via a comment

[issue20825] containment test for ip_network in ip_network

2014-03-06 Thread Michel Albert
Michel Albert added the comment: Here's a new patch implementing both ``subnet_of`` and ``supernet_of``. It also contains the relevant docs and unit-tests. -- Added file: http://bugs.python.org/file34292/net-in-net-r2.patch ___ Python tracker rep

[issue20825] containment test for ip_network in ip_network

2014-03-04 Thread Michel Albert
Michel Albert added the comment: I second supernet_of and subnet_of. I'll implement it as soon as I get around it. I have been thinking about using ``in`` and ``=`` and, while I initially liked the idea for tests, I find both operators too ambiguous. With ``in`` there's the already mentioned

[issue20815] ipaddress unit tests PEP8

2014-03-03 Thread Michel Albert
Michel Albert added the comment: I strongly agree with Raymond's points! They are all valid. I should note, that I submitted this patch to - as mentioned by Nick - familiarise myself with the patch submission process. I decided to make harmless changes which won't risk braking anything

[issue20815] ipaddress unit tests PEP8

2014-03-02 Thread Michel Albert
Michel Albert added the comment: Here's a new patch which addresses white-space issues without touching the old tests. -- Added file: http://bugs.python.org/file34265/test_ipaddress_pep8-r3.patch ___ Python tracker rep...@bugs.python.org http

[issue20825] containment test for ip_network in ip_network

2014-03-02 Thread Michel Albert
New submission from Michel Albert: The ipaddress module always returns ``False`` when testing if a network is contained in another network. However, I feel this should be a valid test. No? Is there any reason why this is fixed to ``False``? In case not, here's a patch which implements

[issue20825] containment test for ip_network in ip_network

2014-03-02 Thread Michel Albert
Michel Albert added the comment: Hmm... after thinking about this, I kind of agree. I was about to state something about the fact that you could consider networks like an ordered set. And use that to justify my addition :) But the more I think about it, the more I am okay with your point. I

[issue20826] Faster implementation to collapse consecutive ip-networks

2014-03-02 Thread Michel Albert
New submission from Michel Albert: This alternative implementation runs over the ``addresses`` collection only once, and backtracks only if necessary. Inspired by a shift-reduce approach. Technically both are O(n), so the best case is always the same. But the old implementation runs over

[issue20815] ipaddress unit tests PEP8

2014-03-01 Thread Michel Albert
New submission from Michel Albert: While I was looking at the source of the ipaddress unit-tests, I noticed a couple of PEP8 violations. This patch fixes these (verified using the ``pep8`` tool). There are no behavioural changes. Only white-space. Test-cases ran successfully before

[issue20815] ipaddress unit tests PEP8

2014-03-01 Thread Michel Albert
Michel Albert added the comment: Thanks for the quick reply! I did not know the pep8 tool added it's own rules :( I have read PEP8 a long while ago and have since relied on the tool to do the right thing. Many of it's idiosyncrasies have probably made their way into my blood since

DNS query against a specific server.

2013-09-30 Thread Michel Albert
Hi, ``socket.gethostbyname`` sends the DNS resolution query to the DNS server specified by the OS. Is there an easy way to send a query to a *different* server? I see that twisted.names allows you to do this, but, having all of twisted as dependency to my project when all I need to do is a

Re: DNS query against a specific server.

2013-09-30 Thread Michel Albert
On Monday, 30 September 2013 14:36:34 UTC+2, William Ray Wing wrote: On Sep 30, 2013, at 7:42 AM, Michel Albert *** wrote: Hi, ``socket.gethostbyname`` sends the DNS resolution query to the DNS server specified by the OS. Is there an easy way to send a query to a *different

Re: DNS query against a specific server.

2013-09-30 Thread Michel Albert
On Monday, 30 September 2013 14:54:41 UTC+2, Ervin Hegedüs wrote: Hello, On Mon, Sep 30, 2013 at 04:42:29AM -0700, Michel Albert wrote: Hi, ``socket.gethostbyname`` sends the DNS resolution query to the DNS server specified by the OS. Is there an easy way to send a query

How to display ReST properly on pypi?

2013-09-14 Thread Michel Albert
In general, I write my README files using the ReST syntax. But when I do, they don't show up formatted on pypi (see for example https://pypi.python.org/pypi/config_resolver/3.3.0). How do I get it to be formatted properly? Also, is there a way to specify that the description field in setup.py

Re: How to display ReST properly on pypi?

2013-09-14 Thread Michel Albert
, 14 September 2013 11:53:12 UTC+2, Chris “Kwpolska” Warrick wrote: On Sat, Sep 14, 2013 at 11:08 AM, Michel Albert wrote: In general, I write my README files using the ReST syntax. But when I do, they don't show up formatted on pypi (see for example https://pypi.python.org/pypi

Making `logging.basicConfig` log to *both* `sys.stderr` and `sys.stdout`?

2011-08-30 Thread Michel Albert
Hi, I use python oftentimes to write automation scripts on Linux servers. And there's a big pattern in my scripts: - I *always* use `logging` instead of `print` statements. - I *always* create two stream handlers. One for `sys.stdout` with level `INFO` and one for `sys.stderr` with level `WARN`

Re: Making `logging.basicConfig` log to *both* `sys.stderr` and `sys.stdout`?

2011-08-30 Thread Michel Albert
On Aug 30, 11:45 am, Peter Otten __pete...@web.de wrote: Michel Albert wrote: I use python oftentimes to write automation scripts on Linux servers. And there's a big pattern in my scripts: - I *always* use `logging` instead of `print` statements. - I *always* create two stream handlers

Using a decorator to *remove* parameters from a call

2009-04-13 Thread Michel Albert
A small foreword: This might look like a cherrypy-oriented post, and should therefore go to the cherrypy group, but if you read to the end, you'll see it's a more basic python problem, with cherrypy only as an example. ;) From the decorator PEP (318) I get it that you can /add/ parameters to a

Re: Using a decorator to *remove* parameters from a call

2009-04-13 Thread Michel Albert
On Apr 13, 12:52 pm, Jon Clements jon...@googlemail.com wrote: On 13 Apr, 11:11, Michel Albert exh...@gmail.com wrote: A small foreword: This might look like a cherrypy-oriented post, and should therefore go to the cherrypy group, but if you read to the end, you'll see it's a more basic

Re: Using a decorator to *remove* parameters from a call

2009-04-13 Thread Michel Albert
On Apr 13, 12:45 pm, Aaron Brady castiro...@gmail.com wrote: On Apr 13, 5:11 am, Michel Albert exh...@gmail.com wrote: A small foreword: This might look like a cherrypy-oriented post, and should therefore go to the cherrypy group, but if you read to the end, you'll see it's a more basic

qrcode in python?

2008-05-21 Thread Michel Albert
I am planning to write a python-module for python as I haven't found anything on the tubes so far. If anyone has any interesting insight on this topic, replies are welcome! ;) Q: What is QR-Code? A: http://www.denso-wave.com/qrcode/qrstandard-e.html So far (as of May 21st 2008): Google (1

Re: Binary search tree

2007-11-12 Thread Michel Albert
On Nov 9, 11:45 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : Hi, I have to get list of URLs one by one and to find the URLs that I have more than one time(can't be more than twice). I thought to put them into binary search tree, this way they'll be

Re: Using python as primary language

2007-11-09 Thread Michel Albert
On Nov 8, 8:55 pm, [EMAIL PROTECTED] wrote: On Nov 8, 1:52 am, Michel Albert [EMAIL PROTECTED] wrote: In our company we are looking for one language to be used as default language. So far Python looks like a good choice (slacking behind Java). A few requirements that the language should

parallel csv-file processing

2007-11-09 Thread Michel Albert
Currently I am faced with a large computation tasks, which works on a huge CSV file. As a test I am working on a very small subset which already contains 2E6 records. The task itself allows the file to be split however as each computation only involves one line. The application performing the

Re: Drawing charts in Qt

2007-11-07 Thread Michel Albert
On Nov 6, 5:08 pm, David Boddie [EMAIL PROTECTED] wrote: On Tue Nov 6 15:46:07 CET 2007, Michel Albert wrote: [PyQwt and matplotlib] PyQwt looks much more interesting, but I have trouble installing it. On my machine it complains that sipconfig has no attribute '_pkg_config

Using python as primary language

2007-11-07 Thread Michel Albert
In our company we are looking for one language to be used as default language. So far Python looks like a good choice (slacking behind Java). A few requirements that the language should be able cope with are: * Database access to Sybase. This seems to be available for python, but the

Drawing charts in Qt

2007-11-06 Thread Michel Albert
I would like to display some charts in a Qt application. But all the docs I find online are rather dusty and talk about Qt3. My application uses Qt4 however. I ran into PyQwt and matplotlib. But the docs of matplotlib are horrid and the example in their wiki covers Qt3, and things look quite

Re: Python + Shoutpy + Twisted Locks

2007-10-07 Thread Michel Albert
On Oct 6, 4:21 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 05 Oct 2007 04:55:55 -0300, exhuma.twn [EMAIL PROTECTED] escribi?: [...] What I found is that libshout is blocking, which should be fine as the whole thing runs in it's separate thread. But the application hangs