Re: [ANN] Falcon - powering innovation
On Sat, Apr 11, 2009 at 4:11 PM, Kless jonas@googlemail.com wrote: [skipped buzzwords] [1] http://www.falconpl.org/ [2] http://www.computerworld.com.au/article/298655/-z_programming_languages_falcon?fp=2fpid= And this table should make you even more interested in Falcon (also called THE BEST PROGRAMMING LANGUAGE EVAR): http://www.falconpl.org/index.ftd?page_id=facts Yes, it's a proven fact that Falcon is better than Python, Ruby, Perl, Lua, PHP, C or Lisp. This is a table of truth! But I have one important question about Falcon: Does it have ponies? -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii V. Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
[issue2522] locale.format() problems with decimal separator
Andrii V. Mishkovskyi misho...@gmail.com added the comment: Nice to see this moving forward. Your patch looks nicer than my naive approach and I hope it's going to be applied. Thanks for investigation. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2522 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5580] Strange error message in Python/getargs.c
New submission from Andrii V. Mishkovskyi misho...@gmail.com: I think the following message is a little bit confusing: Python 2.7a0 (trunk, Mar 17 2009, 12:06:19) [GCC 4.3.2] on linux2 Type help, copyright, credits or license for more information. open('abc\x00') Traceback (most recent call last): File stdin, line 1, in module TypeError: file() argument 1 must be (encoded string without NULL bytes), not str This message could be much more better if unneeded parentheses were removed. :) The message on line 861 in Python/getargs.c reads much better: string without null bytes Would it be appropriate to change the message in topic to something like this? -- messages: 84264 nosy: mishok13 severity: normal status: open title: Strange error message in Python/getargs.c versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5580 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Emulate a printf() C-statement in Python???
On Thu, Mar 19, 2009 at 2:43 PM, Mr. Z no...@xspambellsouth.net wrote: I'm trying emulate a printf() c statement that does, for example char* name=Chris; int age=30; printf(My name is %s, name); printf(My name is %s and I am %d years old., %s, %d); In other words, printf() has a variable arguement list the we all know. I'm trying to do this in Python... class MyPrintf(object): # blah, blah def myprintf(object, *arg): # Here I'll have to know I NEED 2 arguments in format string arg[0] print arg[0] % (arg[1], arg[2]) Note: you can, of course, use any name for the instance variable in methods, but 'self' is considered a de-facto standard, not 'object'. Besides, you're overriding builtin which is considered a bad practice. name=Chris age=30 printf=MyPrintf() printf.myPrintf((My name is %s and I am %d years old., name, age) will of course print... My name is Chris and I am 42 years old. But printf.myPrintf((My name is %s., name) of course gives Index error: list index out of range How can I generalize the print call in the myprintf() function to do this? print arg[0] % (arg[1]) print arg[0] % (arg[1], arg[2]) print arg[0] % (arg[1], ..., arg[n]) It's quite simple: def printf(fmt, *args): print fmt % args -- --- Remove XSPAM -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii V. Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
Re: How to do this in Python? - A gotcha
On Wed, Mar 18, 2009 at 5:51 PM, Jim Garrison j...@acm.org wrote: Jim Garrison wrote: Luis Zarrabeitia wrote: On Tuesday 17 March 2009 06:04:36 pm Jim Garrison wrote: with open(filename, rb) as f: for buf in iter(lambda: f.read(1000),''): do_something(buf) This is the most pythonic solution yet. Thanks to all the responders who took time to ponder this seemingly trivial question. I learned a lot about the Python mind-set. I just tried the code as given above and it results in an infinite loop. Since f.read() returns a byte string when in binary mode, the sentinel has to be b''. Is there a value that will compare equal to both '' and b''? It's a shame the iter(o,sentinel) builtin does the comparison itself, instead of being defined as iter(callable,callable) where the second argument implements the termination test and returns a boolean. This would seem to add much more generality... is it worthy of a PEP? Just before you start writing a PEP, take a look at `takewhile' function in `itertools' module. ;) -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii V. Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
[issue4662] posix module lacks several DeprecationWarning's
New submission from Andrii V. Mishkovskyi misho...@gmail.com: posix module lacks DeprecationWarning for the functions listed below: tempnam, tmpfile, fdopen, getcwdu, popen, tmpnam All of these are absent in 3.0, so I think adding DeprecationWarning to all of them would be useful. Attaching a straight-forward patch against latest trunk checkout. -- files: posixmodule.patch keywords: patch messages: 77810 nosy: mishok13 severity: normal status: open title: posix module lacks several DeprecationWarning's versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file12354/posixmodule.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4662 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4662] posix module lacks several DeprecationWarning's
Changes by Andrii V. Mishkovskyi misho...@gmail.com: Removed file: http://bugs.python.org/file12354/posixmodule.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4662 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4662] posix module lacks several DeprecationWarning's
Andrii V. Mishkovskyi misho...@gmail.com added the comment: I've missed one simple thing -- posix.getcwdu has been renamed to posix.getcwd in 3.0, so adding Py3k deprecation warning to this function is not really needed. Instead a fix for this should be added to the list of 2to3 fixes. I've also fixed the warnings according to Martin's proposal and updated the patch. Added file: http://bugs.python.org/file12356/posixmodule.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4662 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4255] timing module refers to non-existent documentation
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: Well, it's listed in Undocumented modules: http://docs.python.org/library/undoc.html#obsolete so I wouldn't call this a bug. -- nosy: +mishok13 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4255 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Why gives k = 09 a syntax error ?
2008/10/29 Stef Mientki [EMAIL PROTECTED]: hello, Why gives k = 09 a syntax error ? Because leading zero means that the number is octal, and there is no 9 among octal digits. :) thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
Re: XML Processing
2008/9/18 Robert Rawlins [EMAIL PROTECTED]: Guys, I'm running python 2.5 and currently using ElementTree to perform my XML parsing and creation. ElementTree really is a great package for doing this, however, I've been tasked by our deployment guys to try and move away from external libraries where possible as it makes their job easier. Simple question I suppose to start with, does Python have any inbuilt XML processing modules? If the answer is no then I'll stick with eTree, if python does have one, then I'll look at some migration steps. ElementTree is not an external package starting from Python 2.5. It's in stdlib under 'xml.etree.ElementTree' name. There's also a lot of other XML processing modules in stdlib's 'xml' package. Many thanks All, Robert -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
[issue3436] csv.DictReader inconsistency
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: Oh, so this is how the process looks like... /me removes patches I've uploaded both py3k and trunk patches just because I'm fixing things the other way round -- first I write a patch for 3.0 and only after that I backport it to 2.6. Stupid me. :) ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3436] csv.DictReader inconsistency
Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file11016/issue3436.py3k.csv.py.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3436] csv.DictReader inconsistency
Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file11017/issue3436.trunk.csv.py.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3436] csv.DictReader inconsistency
Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]: Added file: http://bugs.python.org/file11016/issue3436.py3k.csv.py.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3436] csv.DictReader inconsistency
Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]: Added file: http://bugs.python.org/file11017/issue3436.trunk.csv.py.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3436] csv.DictReader inconsistency
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: I like the idea of fieldnames attribute being a property, so i've uploaded patches that implement them as such. Both patches ran through make test without problems. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3436] csv.DictReader inconsistency
Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file10967/trunk.csv.py.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3436] csv.DictReader inconsistency
Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file10965/py3k.csv.py.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3436] csv.DictReader inconsistency
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: I'm ok with that. :) Looks like you can close this one as won't fix. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3436] csv.DictReader inconsistency
New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]: I had to use csv module recently and ran into a problem with DictReader. I had to get headers of CSV file and only after that iterate throgh each row. But AFAIU there is no way to do it, other then subclassing. So, basically, right now we have this: Python 3.0b2+ (unknown, Jul 24 2008, 12:15:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type help, copyright, credits or license for more information. import csv r = csv.DictReader(open('test.csv')) r.fieldnames next(r) {'baz': '13', 'foo': '42', 'bar': '27'} r.fieldnames ['foo', 'bar', 'baz'] I think it would be much more useful, if DictReader got 'fieldnames' on calling __init__ method, so this would look like this: r = csv.DictReader(open('test.csv')) r.fieldnames ['foo', 'bar', 'baz'] The easy way to do this is to subclass csv.DictReader. The hard way to do this is to apply the patches I'm attaching. :) These patches also remove redundant check for self.fieldnames being None for each next()/__next__() call -- files: py3k.csv.py.diff keywords: patch messages: 70207 nosy: mishok13 severity: normal status: open title: csv.DictReader inconsistency versions: Python 2.6, Python 3.0 Added file: http://bugs.python.org/file10965/py3k.csv.py.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3436] csv.DictReader inconsistency
Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]: Added file: http://bugs.python.org/file10966/trunk.csv.py.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3436] csv.DictReader inconsistency
Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file10966/trunk.csv.py.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3436] csv.DictReader inconsistency
Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]: Added file: http://bugs.python.org/file10967/trunk.csv.py.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3436] csv.DictReader inconsistency
Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]: -- components: +Library (Lib) type: - behavior ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3436] csv.DictReader inconsistency
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: And how this method should look? Something like this, I suppose: def getheader(self): if self.fieldnames is None: try: self.fieldnames = self.reader.next() except StopIteration: pass return self.fieldnames Well, adding new API after beta2 is a no-no as I understand, so this getheader() method can be added only in 2.7/3.1 releases. Should I post updated patches or just live with it? ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3256] Multiprocessing docs are not 3.0-ready
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: btw, some of the docstrings are also outdated, e.g. Pool.imap, Pool.map, etc. Should I handle this one too? ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3256 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3256] Multiprocessing docs are not 3.0-ready
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: OK, I'll work on this too. :) Patch should be ready by Monday. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3256 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3256] Multiprocessing docs are not 3.0-ready
Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file10848/multiprocessing.rst.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3256 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3256] Multiprocessing docs are not 3.0-ready
Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]: Added file: http://bugs.python.org/file10960/issue3256.multiprocessing.rst.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3256 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3256] Multiprocessing docs are not 3.0-ready
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: Here is the updated version of multiprocessing.rst patch. Not much has changes, as you can see (if you've seen the previous version, of course ;) ). I have only one question left about multiprocessing.rst, it's about 'allow_connection_pickling' function -- should documentation cover this function or just leave it as it is? The only issue I still have is mp_distributing.py example, which is not properly documented. Jesse, I think you should review both patches and leave this issue open until mp_distributing.py is documented. If you have any questions -- ping me on #python-dev. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3256 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3375] _multiprocessing.so build problems
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: Attached the log of 'make -d' on clean checkout of py3k branch. This is on Ubuntu 8.04.1. -- nosy: +mishok13 Added file: http://bugs.python.org/file10907/make-d.log.bz2 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3375 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3352] Deficiencies in multiprocessing/threading API
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: Actually, 'getx' - 'fget'. Sorry for the typo. :) ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3352 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3354] sort(reverse=None) prints misleading error message
Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]: -- nosy: +mishok13 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3354 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Returning the positions of a list that are non-zero
2008/7/9 Benjamin Goudey [EMAIL PROTECTED]: I have a very large list of integers representing data needed for a histogram that I'm going to plot using pylab. However, most of these values (85%-95%) are zero and I would like to remove them to reduce the amount of memory I'm using and save time when it comes to plotting the data. To do this, I'm trying to find the best way to remove all of the zero values and produce a list of indices of where the non-zero values used to be. For example, if my original list is [0,0,1,2,1,0,0] I would like to produce the lists [1,2,1] (the non zero values) and [2,3,4] (indices of where the non-zero values used to be). Removing non-zero values is very easy but determining the indicies is where I'm having difficulty. Thanks in advance for any help l = [0, 0, 1, 2, 1, 0, 0] zip(*[(item, index) for (index, item) in enumerate(l) if item != 0]) [(1, 2, 1), (2, 3, 4)] -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
[issue3325] use of cPickle in multiprocessing
New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]: There are two places in multiprocessing where cPickle (gone from py3k already) is used. Both of them are in try .. except, so they don't break code. Here is a patch that removes these uses. -- components: Library (Lib) messages: 69463 nosy: jnoller, mishok13, roudkerk severity: normal status: open title: use of cPickle in multiprocessing versions: Python 3.0 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3325 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3325] use of cPickle in multiprocessing
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: And here is the patch. -- keywords: +patch Added file: http://bugs.python.org/file10867/issue3325.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3325 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3256] Multiprocessing docs are not 3.0-ready
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: OK, then ignore the previous email, I'll send you a new one, with updated questions. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3256 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3315] abc.rst little error
New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]: 'make html' with latest py3k sources produces this warning: WARNING: /home/mishok/doc/python/abc-doc-bug/Doc/library/abc.rst:11: term not in glossary: abstract base classes I've applied little patch that fixes this. -- assignee: georg.brandl components: Documentation files: abc.rst.diff keywords: patch messages: 69390 nosy: georg.brandl, mishok13 severity: normal status: open title: abc.rst little error versions: Python 3.0 Added file: http://bugs.python.org/file10844/abc.rst.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3315 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3256] Multiprocessing docs are not 3.0-ready
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: So, after 5 days of silence I present my current status on the patch. This patch fixes Doc/includes/mp_*.py examples, except for the fact that I couldn't make mp_distributing.py work, but I'm still working on this issue. -- keywords: +patch Added file: http://bugs.python.org/file10847/examples.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3256 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3256] Multiprocessing docs are not 3.0-ready
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: And this patch is for Doc/library/multiprocessing.rst. Still, there are lot of issues, and as you none of you (Jesse or Richard) answered my email, I'll post them tomorrow here. Right now, the patch. :) Added file: http://bugs.python.org/file10848/multiprocessing.rst.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3256 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3283] multiprocessing.connection doesn't import AuthenticationError, while using it
New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]: Lib/multiprocessing/connection.py contains two uses of AuthenticationError, while it's not imported from multiprocessing package. This exception is used in deliver_challenge() and answer_challenge() functions. I've attached a small patch that fixes possible NameError while calling any of these two functions. -- components: Library (Lib) files: multiprocessing.connection.py.diff keywords: patch messages: 69255 nosy: jnoller, mishok13, roudkerk severity: normal status: open title: multiprocessing.connection doesn't import AuthenticationError, while using it versions: Python 3.0 Added file: http://bugs.python.org/file10809/multiprocessing.connection.py.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3283 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3273] multiprocessing and meaningful errors
New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]: multiprocessing uses a lot of `assert` statements all over the code. I propose to change this way to a more readable and understandable. For example: Lib/multiprocessing/managers.py, line 136: assert isinstance(authkey, bytes) From my point of view, raising an AssertionError is not enough in this case. I propose changing this one to more intuitive: if not isinstance(authkey, bytes): raise TypeError('authkey' argument should be an instance of 'bytes') (Well, maybe message could be more descriptive. :) ) And this goes for all of the multiprocessing code base. Should I consider writing a patch for this? -- components: Library (Lib) messages: 69208 nosy: jnoller, mishok13, roudkerk severity: normal status: open title: multiprocessing and meaningful errors type: feature request versions: Python 2.6, Python 3.0 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3273 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3256] Multiprocessing docs are not 3.0-ready
New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]: Multiprocessing docs contain examples, that are not valid py3k code, mostly because of print used as a statement. Example (taken from multiprocessing.rst): from multiprocessing import Process def f(name): print 'hello', name if __name__ == '__main__': p = Process(target=f, args=('bob',)) p.start() p.join() If no one is working on this already, than I'll start fixing this and will present a patch in 2 or 3 days. -- assignee: georg.brandl components: Documentation messages: 69090 nosy: georg.brandl, jnoller, mishok13, roudkerk severity: normal status: open title: Multiprocessing docs are not 3.0-ready versions: Python 3.0 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3256 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3204] operator module docs are not updated to 3.0
New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]: __*slice__() methods of sequence-like objects are removed in Python 3.0, but operator.rst has sections on *slice()/__*slice__() functions. Attached patch removes this functions from documentation. -- assignee: georg.brandl components: Documentation files: operator.rst.diff keywords: patch messages: 68766 nosy: georg.brandl, mishok13 severity: normal status: open title: operator module docs are not updated to 3.0 versions: Python 3.0 Added file: http://bugs.python.org/file10739/operator.rst.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3204 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3206] Multiprocessing Array and sharedctypes.Array error in docs/implementation
New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]: multiprocessing.sharedctypes.Array and multiprocessing.sharedctypes.Value if used according to documentation fail with AssertionError. Python 3.0b1+ (py3k:64518, Jun 25 2008, 12:52:38) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type help, copyright, credits or license for more information. from multiprocessing import sharedctypes sharedctypes.Array('i', 1, lock=True) Traceback (most recent call last): File stdin, line 1, in module File /usr/local/lib/python3.0/multiprocessing/sharedctypes.py, line 88, in Array assert hasattr(lock, 'acquire') AssertionError sharedctypes.Array('i', 1, lock=False) Traceback (most recent call last): File stdin, line 1, in module File /usr/local/lib/python3.0/multiprocessing/sharedctypes.py, line 88, in Array assert hasattr(lock, 'acquire') AssertionError sharedctypes.Array('i', 1, lock=None) SynchronizedArray wrapper for multiprocessing.sharedctypes.c_long_Array_1 object at 0x83214f4 Value('i', lock=True) Traceback (most recent call last): File stdin, line 1, in module File /usr/local/lib/python3.0/multiprocessing/__init__.py, line 246, in Value return Value(typecode_or_type, *args, **kwds) File /usr/local/lib/python3.0/multiprocessing/sharedctypes.py, line 75, in Value assert hasattr(lock, 'acquire') AssertionError The same goes for multiprocessing.Array and multiprocessing.Value. Comparing code to documentation it's obvious that lock argument can be one of Lock, RLock or None objects (or any object with acquire attribute), but not True or False. Also, looking at the code it seems strange to me that 'lock' is a keyword-only argument. Why not use simple default argument lock=None for Array() function? Proposed patch tries to address these issues. -- components: Library (Lib) messages: 68771 nosy: jnoller, mishok13, roudkerk severity: normal status: open title: Multiprocessing Array and sharedctypes.Array error in docs/implementation versions: Python 3.0 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3206 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3206] Multiprocessing Array and sharedctypes.Array error in docs/implementation
Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]: -- assignee: - georg.brandl components: +Documentation nosy: +georg.brandl ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3206 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3206] Multiprocessing Array and sharedctypes.Array error in docs/implementation
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: And here is the patch itself. :) -- keywords: +patch Added file: http://bugs.python.org/file10741/multiprocessing.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3206 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3211] warnings.warn_explicit raises SystemError
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: Even more, Python 3.0 crashes from following code: Python 3.0b1+ (py3k:64528M, Jun 26 2008, 11:40:20) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type help, copyright, credits or license for more information. from warnings import warn_explicit warn_explicit(None, UserWarning, None, 0, None, None) Traceback (most recent call last): File stdin, line 1, in module SystemError: Objects/dictobject.c:709: bad argument to internal function warn_explicit(None, UserWarning, None, 0, None, {}) Segmentation fault -- nosy: +mishok13 type: - crash versions: +Python 3.0 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3211 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3195] invalid conversion xml.etree.ElementTree.Element object to boolean
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: To quote Python Library Reference, paragraph 3.1: Any object can be tested for truth value, for use in an if or while condition or as operand of the Boolean operations below. The following values are considered false: [skipped] - instances of user-defined classes, if the class defines a __nonzero__() or __len__() method, when that method returns the integer zero or bool value False. And back to python console: In [112]: from xml.etree.ElementTree import Element In [113]: e = Element('foo', {'key': 'value'}) In [114]: len(e) Out[114]: 0 In [115]: not e Out[115]: True This is because Element is just a container and acts more like a list. So, if you actually append items to this list-like structure, you'll get this: In [116]: e.append(Element('bar', {42: 1337})) In [117]: e.append(Element('baz', {'whatever': 'wherever'})) In [118]: len(e) Out[118]: 2 In [119]: not e Out[119]: False In conclusion, this just doesn't look like a bug to me. You could try using if e is not None form. -- nosy: +mishok13 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: IDE on the level of Eclipse or DEVc++?
2008/6/23 cirfu [EMAIL PROTECTED]: is there an IDE for python of the same quality as Eclipse or DEVC++? I am currently using the editor that coems iwth python and it is all fine but for bigger projects it would be nice to have some way to easier browse the projectfiles for example. Actually, there is a great plugin for Eclipse, called PyDev. You should check it out. :) -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
[issue3178] __radd__(self, other) isn't called if self and other are of the same class
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: This is covered in section 3.4.7 of Python Reference Manual: __radd__(self, other) [skipped] These methods are called to implement the binary arithmetic operations (+, -, *, /, %, divmod(), pow(), **, , , , ^, |) with reflected (swapped) operands. These functions are only called if the left operand does not support the corresponding operation and the operands are of different types.[3.3] For instance, to evaluate the expression x-y, where y is an instance of a class that has an __rsub__() method, y.__rsub__(x) is called if x.__sub__(y) returns NotImplemented. [3.3] For operands of the same type, it is assumed that if the non-reflected method (such as __add__()) fails the operation is not supported, which is why the reflected method is not called. -- nosy: +mishok13 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3178 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: How do I create user-defined warnings?
2008/6/18 Clay Hobbs [EMAIL PROTECTED]: I already know how to make user-defined exceptions, like this one: class MyException(Exception): pass But for a module I'm making, I would like to make a warning (so it just prints the warning to stderr and doesn't crash the program). I have tried this: class MyWarning(Warning): pass And it behaves like a normal error. Please help me, I can't figure out what I'm doing wrong. Use 'warnings' module. http://docs.python.org/lib/module-warnings.html -- Ratfink -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
Re: bpython - fancy Python shell
2008/6/15, Bob Farrell [EMAIL PROTECTED]: I released this a while ago but did some work recently to fix some bugs so I thought I may as well post it here. To quickly summarise: In-line syntax highlighting Auto complete with suggestions as you type Pastebin stuff, save to file Rewind feature to jump back a line if you mess up (don't ask how it works, please ;) You can get it here: http://www.noiseforfree.com/bpython/ There's info about git repos and what have you there, and apparently it's also in some real distro repos, but I don't know the details. Oh, and you'll need pygments and pyparsing, and it doesn't work on Windows (heard good reports about it working fine on a Mac though). Great work, bobf. :) I've been using bpython from time to time for a month now, so I can only appreciate the fact that bpython is developing. I think that with that speed of development bpython will substitute ipython as my everyday python console in the near future (3-4 months). P.S. I think you should of cc'd this announcement to python-announce-list. ;) -- Bob Farrell -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
Re: Ideas for master's thesis
2008/6/4 Larry Bugbee [EMAIL PROTECTED]: I would like to do something with this language, yet I don't know if there are any needs/science fields, that could be used as a basis for a thesis. Personally, I'd like to see *optional* data typing added to Python perhaps along the lines of what was done in Pyrex. You declare the data type when you know it, or when it matters, and skip it otherwise. Your paper could analyze its pros and cons, analyze any potential performance gains, and recommend how to implement it. Your professor will suggest some additional questions. I suspect, if the type be known and declared, the interpreter could be streamlined and quicker, you might get asserts for free, and perhaps, Python becomes even more self-documenting. Perhaps I've missed it, but I haven't seen a strong analytical case made for or against optional data typing. Your paper? I think what you are talking about is already implemented in Python 3.0 as annotations. Forgive me if I missed your point. Larry -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python is slow
2008/5/22 cm_gui [EMAIL PROTECTED]: Python is slow.Almost all of the web applications written in Python are slow. Zope/Plone is slow, sloow, so very slooow. Even Google Apps is not faster. Neither is Youtube. Facebook and Wikipedia (Mediawiki), written in PHP, are so much faster than Python. Okay, they probably use caching or some code compilation -- but Google Apps and those Zope sites probably also use caching. I've yet to see a web application written in Python which is really fast. Troll harder. -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
[issue2890] O_ASYNC and FASYNC should be defined for *nix systems
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: These flags are non-posix, linux-specific constants. Python 'os' module uses 'posix' module for all *nix systems, including those, that do not support O_ASYNC and FASYNC flags. I think your feature request should be rejected. -- nosy: +mishok13 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2890 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2890] O_ASYNC and FASYNC should be defined for *nix systems
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: I think they at least should be supported on Linux then. And what happens if some Unix flavor (i.e. Solaris) adds new flag, say O_NONLINUXSYNC and it has the same value as linux's O_ASYNC? And then FreeBSD adds O_BSDSYNC flag with the same number and so on. Then Python will have to have separate system-specific module for each *nix system that uses Python. Why do you think Python maintainers would want that? It does work if you use the value itself anyway. It's the way fcntl works -- it's just a thin layer on top of fcntl() and ioctl() calls. But that's not a good reason for including non-posix flags to 'posix' module __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2890 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: built in list generator?
2008/5/14 Ethan Furman [EMAIL PROTECTED]: Ben Finney wrote: Subject: Re: built in list generator? From: Ben Finney [EMAIL PROTECTED] Date: Wed, 14 May 2008 09:43:43 +1000 To: python-list@python.org To: python-list@python.org Newsgroups: comp.lang.python Diez B. Roggisch [EMAIL PROTECTED] writes: globalrev schrieb: if i want a list with all numbers between x and y is there a way to do this with an inbult function. i mean i can always construct a function to do this but is there soemthing like: nbrs = list(range(50,100, 2)) range *does* that. use xrange if all you want is to iterate. Until Python 3.0, where 'range' returns an iterable. Is there a thread somewhere of the discussion for this change? I'm presuming range is used almost exclusively in loops where a change in the return type would have no negative effect. -- http://mail.python.org/pipermail/python-dev/2003-April/034534.html Ethan -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python and Flaming Thunder
You sound like a commercial. Is this your way of attracting costumers of FT? 2008/5/13 Dave Parker [EMAIL PROTECTED]: 5-10 times faster for what kind of code? Mostly numerical analysis and CGI scripting. All of Flaming Thunder's library code is in assembly language, and Flaming Thunder creates statically-linked pure syscall CGI scripts. I don't see anything that resembles OO features of python, ... True. But in Python, you don't see statically-linked pure-syscall CGI scripts being cross-compiled under Windows for ftp'ing up to a Linux server. And you don't see the speed of pure assembly language libraries. I see your assembly language libraries and raise you C language libraries. :) Python libraries have the speed of pure C language libraries. And while programs and libraries written in assembly may be twice as fast as programs and libraries written in C, they're real hell to maintain. But that doesn't stop you from telling us, that: And I'll be willing to bet that Flaming Thunder will have OO features similar to Python before Python has the features that Flaming Thunder already does. Well, we'll see. But, IMHO, this is highly unlikely. For many people, being 5 to 10 times faster at numerical analysis and CGI scripting is reason enough to pay $19 per year. But maybe for other people, having slow, inefficient programs and websites is acceptable. Yeah, right, Python is so slow. :) Show us some sites and programs that were written in FT. And what is really expensive is brain-cycles, not cpu-cycles. Depends on whether you're the programmer, or the customer. I've found that customers prefer products that are 5 to 10 times faster, instead of products that were easy for the developer. If I'm customer, than why should I care about FT? If I'm a programmer, I'd better care about brain-cycles. And I disagree that Flaming Thunder requires more brain-cycles. Because it's based on leveraging existing English and math fluency (which was one of the original goals of Python, was it not?), I think that Flaming Thunder requires fewer brain-cycles because fewer brains cells have to be devoted to memorizing language peculiarities. Not everybody has grown in English-speaking community, you know. And knowing math quite good, I prefer writing x = y instead of Set x to y. Let alone it is very much a question of view-point if two different looping constructs or keywords are more awkward than one general looping-concept with only one keyword. It's a matter of taste. Perhaps. But if elementary school students can easily understand why one programming language gives the answer 100 (Flaming Thunder): Write 10^2. but can't understand why another programming language gives the answer 8 (Python): Print 10^2 then I think the comparison moves beyond a matter of taste into the realm of measurable ease-of-use. '^' is a bitwise XOR. Python uses x**y for raising x to power of y. What's your point here? On May 13, 9:50 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: Also, several users have rewritten their Python programs in Flaming Thunder, and found that Flaming Thunder was 5 to 10 times faster (Flaming Thunder compiles to native executables). So again, since many people value their time at more than $0, I think that many people will find that Flaming Thunder is worth $19.95 per year. 5-10 times faster for what kind of code? I don't see anything that resembles OO features of python, let alone more advanced concepts like meta-programming, higher-order functions and such. Which save tremendous amounts of time coding. If FT grows these and *still* is 5-10 times faster, I'll salut you. And what is really expensive is brain-cycles, not cpu-cycles. Which above described features save. Plus, me getting paid to work on Flaming Thunder is far more motivating than me not getting paid to work on Python. This weekend, Python users will still be debating how to fix awkwardnesses in the languages (such as FOR loops where you're just counting the loops and not referencing the loop variable) -- but Flaming Thunder users will be getting work done using the REPEAT n TIMES constructs that I'll be implementing. Python has been around about 15 years, yet still has those awkwardnesses. Flaming Thunder has been out less than 6 months and those awkwardnesses are already getting fixed. The difference: I can't afford to ignore users. Oh *please*! Try getting nearly as feature library complete as python is today - and *then* I'll point to all the akwardness of FT. Let alone it is very much a question of view-point if two different looping constructs or keywords are more awkward than one general looping-concept with only one keyword. It's a matter of taste. Diez -- http://mail.python.org/mailman/listinfo/python-list
Re: strftime() argument 1 must be str, not unicode
2008/5/8 Tim Roberts [EMAIL PROTECTED]: Andrii V. Mishkovskyi [EMAIL PROTECTED] wrote: 2008/5/7 Alexandr N Zamaraev [EMAIL PROTECTED]: Subj is bag? Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. from datetime import datetime datetime.today().strftime('%Y_%m_%d %H_%M_%S.csv') '2008_05_07 12_30_22.csv' datetime.today().strftime(u'%Y_%m_%d %H_%M_%S.csv') Traceback (most recent call last): File stdin, line 1, in module TypeError: strftime() argument 1 must be str, not unicode Unicode and str objects are not the same. Why do you think that this is a bug? I think that's a perfectly reasonable thing to expect. At the risk of over-generalization, there is no good reason why, by this point in time, all of the standard library routines that accept strings shouldn't also accept Unicode strings. It's the duck typing principle. Unicode strings look, walk, and talk like regular strings. An error like this is not intuitive. On a second thought -- both of you (you and Alexander) are right. I changed mind and posted a bug on Roundup already (bug #2782). -- Tim Roberts, [EMAIL PROTECTED] Providenza Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
Re: strftime() argument 1 must be str, not unicode
2008/5/7 Alexandr N Zamaraev [EMAIL PROTECTED]: Subj is bag? Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. from datetime import datetime datetime.today().strftime('%Y_%m_%d %H_%M_%S.csv') '2008_05_07 12_30_22.csv' datetime.today().strftime(u'%Y_%m_%d %H_%M_%S.csv') Traceback (most recent call last): File stdin, line 1, in module TypeError: strftime() argument 1 must be str, not unicode Unicode and str objects are not the same. Why do you think that this is a bug? Anyway, you can always use 'encode' method of unicode objects: In [2]: datetime.today().strftime('%Y-%m-%d %H-%M-%S.csv') Out[2]: '2008-05-07 10-49-24.csv' In [3]: datetime.today().strftime(u'%Y-%m-%d %H-%M-%S.csv') --- TypeError Traceback (most recent call last) /home/mishok/doc/python/ipython console in module() TypeError: strftime() argument 1 must be str, not unicode In [4]: datetime.today().strftime(u'%Y-%m-%d %H-%M-%S.csv'.encode('utf-8')) Out[4]: '2008-05-07 10-51-19.csv' No offence, but have you read the tutorial? -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
[issue2782] datetime/date strftime() method and time.strftime() inconsistency
New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]: datetime and date strftime() method does additional check on input format, thus being completely different from time's module time.strftime() method behavior. There are two ways to fix this: 1. Add an explicit note about this behavior (e.g., only 'str' objects are allowed for format strings) in docs (section 5.1.7). 2. Allow 'unicode' objects for format strings (backport time.strftime() from 3.0?). Here is a traceback for a more complete overview: Python 2.6a2+ (trunk:62762, May 6 2008, 14:37:27) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type help, copyright, credits or license for more information. from datetime import datetime, date import time uformat = u'%Y-%m-%D %H-%M-%S' format = '%Y-%m-%D %H-%M-%S' datetime.today().strftime(uformat) Traceback (most recent call last): File stdin, line 1, in module TypeError: strftime() argument 1 must be str, not unicode datetime.today().strftime(format) '2008-05-05/07/08 17-19-03' time.strftime(uformat) '2008-05-05/07/08 17-19-10' time.strftime(format) '2008-05-05/07/08 17-19-16' date.today() datetime.date(2008, 5, 7) date.today().strftime(format) '2008-05-05/07/08 00-00-00' date.today().strftime(uformat) Traceback (most recent call last): File stdin, line 1, in module TypeError: strftime() argument 1 must be str, not unicode -- components: Library (Lib) messages: 66360 nosy: mishok13 severity: normal status: open title: datetime/date strftime() method and time.strftime() inconsistency type: behavior versions: Python 2.5, Python 2.6 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2782 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: from __future__ import print
2008/4/10, [EMAIL PROTECTED] [EMAIL PROTECTED]: Am I the only one that thinks this would be useful? :) I'd really like to be able to use python 3.0's print statement in 2.x. Is this at least being considered as an option for 2.6? It seems like it would be helpful with transitioning. It's not only considered but have been already implemented. Enjoy. :) Python 2.6a2+ (trunk:62269, Apr 10 2008, 20:18:42) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type help, copyright, credits or license for more information. from __future__ import print_function print asd File stdin, line 1 print foo ^ SyntaxError: invalid syntax print(foo) foo -- http://mail.python.org/mailman/listinfo/python-list -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
Re: @x.setter property implementation
2008/4/7, Floris Bruynooghe [EMAIL PROTECTED]: Have been grepping all over the place and failed to find it. I found the test module for them, but that doesn't get me very far... I think you should take a look at 'descrobject.c' file in 'Objects' directory. -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
[issue2522] locale.format() problems with decimal separator
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: I've uploaded a patch that fixes this concrete issue, though locale.format() continues to silently ignore other types of malformed strings (e.g. locale.format('%fSPAMf')). I don't think this is correct behavior. Maybe there should be reg-exp that locale.format() will use to avoid such issues. -- components: +Library (Lib) keywords: +patch Added file: http://bugs.python.org/file9918/locale.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2522 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2522] locale.format() problems with decimal separator
New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]: locale.format() doesn't insert correct decimal separator to string representation when 'format' argument has '\r' or '\n' symbols in it. This bug has been reproduced on Python 2.5.2 and svn-trunk. Python 2.4.5 (#2, Mar 12 2008, 14:42:24) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu4)] on linux2 Type help, copyright, credits or license for more information. import locale locale.setlocale(locale.LC_ALL, ru_RU.UTF-8) 'ru_RU.UTF-8' a = 1.234 print locale.format(%f, a) 1,234000 print locale.format(%f\n, a) 1,234000 print locale.format(%f\r, a) 1,234000 Python 2.6a1+ (trunk:62083, Mar 31 2008, 19:24:56) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu6)] on linux2 Type help, copyright, credits or license for more information. import locale locale.setlocale(locale.LC_ALL, ru_RU.UTF-8) 'ru_RU.UTF-8' a = 1.234 print locale.format(%f, a) 1,234000 print locale.format(%f\n, a) 1.234000 print locale.format(%f\r, a) 1.234000 Python 2.5.2 (r252:60911, Mar 12 2008, 13:36:25) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu4)] on linux2 Type help, copyright, credits or license for more information. import locale locale.setlocale(locale.LC_ALL, ru_RU.UTF-8) 'ru_RU.UTF-8' a = 1.234 print locale.format(%f, a) 1,234000 print locale.format(%f\n, a) 1.234000 print locale.format(%f\r, a) 1.234000 -- messages: 64787 nosy: mishok13 severity: normal status: open title: locale.format() problems with decimal separator type: behavior versions: Python 2.5, Python 2.6 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2522 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: A JEW hacker in California admits distributing malware that let him steal usernames and passwords for Paypal accounts.
2007/11/14, ChairmanOfTheBored [EMAIL PROTECTED]: On Tue, 13 Nov 2007 16:18:58 +0100, Richard G Riley [EMAIL PROTECTED] wrote: Your ascii art, while pretty, convinces no one ... It's pretty goddamned retarded, actually... as was the post itself. -- http://mail.python.org/mailman/listinfo/python-list And another one plonked. -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
Fwd: Namespace question
2007/10/31, Frank Aune [EMAIL PROTECTED]: Hello, Is it possible writing custom modules named the same as modules in the standard library, which in turn use the same module from the standard library? Say I want my application to have a random.py module, which in turn must import the standard library random.py module also, to get hold of the randint function for example. My attempts so far only causes my random.py to import itself instead of the standard library random.py Receipt for disaster? :) You mean something like this: import random def foo(): ...print '42' random.randit = foo random.randit() 42 am I right? -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
Re: shouldn't 'string'.find('ugh') return 0, not -1 ?
2007/10/31, jelle [EMAIL PROTECTED]: the subject pretty much says it all. if I check a string for for a substring, and this substring isn't found, should't the .find method return 0 rather than -1? this breaks the if check.find('something'): do(somethingElse) idiom, which is a bit of a pity I think. cheers, -jelle -- http://mail.python.org/mailman/listinfo/python-list 'foo'.find('f') returns 0 What's your point? :/ -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list
Re: Off Topic: Gmail hates newsgroups!!!
2007/10/4, Robert Dailey [EMAIL PROTECTED]: I don't know how many other people subscribe to the python mailing list and use the mailing list using the web-based interface for Gmail, but I do. I use it mainly because Gmail doesn't support IMAP and I use my email from multiple locations. Gmail web based works fine except that it starts your caret off BEFORE the reply instead of AFTER it. They don't even have an option to change this either. I'm just ranting this because it upsets me :) If anyone might know of a firefox plugin or something to fix this I'd be more than willing to use it. I've looked a bit myself for such an extension and I've been unsuccessful in finding one. -- http://mail.python.org/mailman/listinfo/python-list JFGI If you are using Firefox use this Greasemonkey script: http://userscripts.org/scripts/show/8041 or this extension: https://addons.mozilla.org/en-US/firefox/addon/4866 -- Wbr, Andrii Mishkovskyi. He's got a heart of a little child, and he keeps it in a jar on his desk. -- http://mail.python.org/mailman/listinfo/python-list