Re: Asynchronous processing is more efficient -- surely not?

2018-04-04 Thread Matěj Cepl
On 2018-04-04, 07:27 GMT, Steven D'Aprano wrote: > I'm no expert, but it seems to me that this has surely got to > be crazy talk. Whatever task you're doing, processing it > asynchronously doesn't reduce the amount of work. For example, > if you want to download ten files, you still have to down

Re: textwrap.fill algorithm? (Difference with vim)

2017-04-22 Thread Matěj Cepl
On 2017-04-22, 18:33 GMT, Peter Otten wrote: > Yes, the documentation should warn about the limitations of > textwrap's notion of width -- but still, the line you > complained about Perhaps, I have screwed up somewhere, but I am glad we were able to figure it out. Thank you for your patience,

Re: textwrap.fill algorithm? (Difference with vim)

2017-04-22 Thread Matěj Cepl
On 2017-04-22, 01:01 GMT, Gregory Ewing wrote: > I don't know what vim is doing, but if you tell Python you > want lines no longer than 65 characters, it takes you at > your word. Oh, I’ve got it. textwrap.fill() (only in Python 2.*?) completely sucks with bytes, because of course it counts every

Re: textwrap.fill algorithm? (Difference with vim)

2017-04-21 Thread Matěj Cepl
On 2017-04-21, 21:54 GMT, Peter Otten wrote: > It's not the algorithm, it's the width. Try > textwrap.fill(text, 72). I don’t understand. Why 72? I have set tw=65 in vim. Matěj -- https://matej.ceplovi.cz/blog/, Jabber: mc...@ceplovi.cz GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B

textwrap.fill algorithm? (Difference with vim)

2017-04-21 Thread Matěj Cepl
, Matěj Cepl ~$ git diff -- mind.rst diff --git a/mind.rst b/mind.rst index a9523c2..e55c56b 100644 --- a/mind.rst +++ b/mind.rst @@ -63,16 +63,18 @@ personal religious belief. It is a commentary, in the light of specialised knowledge, on a particular set of statements made in the Christian

urllib2: correct way how to add a header to the *initial* request?

2014-02-08 Thread Matěj Cepl
Hi, this is probably a dumb question but I just cannot find a way how to create AuthHandler which would add Authorization header to the FIRST request. The only thing I see in urllib2.py are various http_error handler which add Authorization header to the ADDITIONAL request which handles the er

urllib2: correct way how to add a header to the *initial* request?

2014-02-08 Thread Matěj Cepl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, this is probably a dumb question but I just cannot find a way how to create AuthHandler which would add Authorization header to the FIRST request. The only thing I see in urllib2.py are various http_error handler which add Authorization header

Re: Python declarative

2014-01-25 Thread Matěj Cepl
[This message has also been posted to gmane.comp.python.general.] -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2014-01-25, 07:18 GMT, Frank Millman wrote: > I have stated that my objective is to express as little as > possible in Python code. Yes, and I believe that it is very wrong. But any

Re: Python declarative

2014-01-24 Thread Matěj Cepl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2014-01-24, 11:18 GMT, you wrote: > Write your rendering engine as a few simple helper functions, > and then put all the rest in as code instead of XML. The > easiest way to go about it is to write three forms, from > scratch, and then look at th

Re: How to write this as a list comprehension?

2014-01-18 Thread Matěj Cepl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2014-01-17, 23:19 GMT, you wrote: > But defining the auxfunc takes away the elegance of a list > comprehension. Au contraire! Remember, that brevity is the sister of talent. I would definitively vote for labels = [make_label(then, name) f

Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined?

2014-01-11 Thread Matěj Cepl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2014-01-11, 08:07 GMT, you wrote: > Hi, I've just begun to learn programming, I have an open question for the > group: > Is the Python language an all in one computer language which could replace C, > C++, Java etc.. I only ask becuase I am starti

Is email.parser a good replacement for formail?

2014-01-09 Thread Matěj Cepl
Hi, I have a script (https://github.com/mcepl/gg_scraper) where I need to read possibly malformed mbox messages. I use subprocess.Popen() and /usr/bin/formail to clean up them to be correct mbox messages (with correct leading From line etc.). Now I try to run tests for my script on Travis-CI, wh

BDD behave support for vim

2013-09-17 Thread Matěj Cepl
Hi, I know that vim has native support for cucumber (the original BDD framework for Ruby). I have also found https://github.com/veloce/vim-behat for BDD with PHP (frightening idea!), but I haven't found a module supporting BDD with vim and Python. Especially I envy to our Ruby friends ability

Re: Where are documentation for Gnome

2012-10-15 Thread Matěj Cepl
On Sat, 13 Oct 2012 20:14:50 +0200, Kwpolska wrote: > https://live.gnome.org/EyeOfGnome/Plugins#Python > > That is all the documentation in existence for Python plugins. > > Examples: > http://git.gnome.org/browse/eog-plugins/tree/plugins/slideshowshuffle > http://git.gnome.org/browse/eog-plugins

[ANN] json_diff 0.9.2 released - JSON files comparator

2011-11-21 Thread Matěj Cepl
I released json_diff 0.9.2. http://pypi.python.org/pypi/json_diff json_diff is an utility comparing two JSON files and generating diff in form of another JSON file with differences for each level of the object in a dict { "_append": {}, "_remove": {}, "_update": {} } This is the fir