[issue23123] Only READ support for Decimal in json

2014-12-29 Thread Anders Rundgren
Anders Rundgren added the comment: Well, I could have insisted on canonicalization of floating-point data but that's so awkward that outlawing such data is a cleaner approach. Since the target for JCS is security- and payment-protocols, I don't think the absence of floating-point support

[issue23123] Only READ support for Decimal in json

2014-12-29 Thread Anders Rundgren
Anders Rundgren added the comment: Using simplejson I got it to work!!! I just wonder what you think of the solution: import collections import simplejson as json from decimal import Decimal class EnhancedDecimal(Decimal): def __str__ (self): return self.saved_string def __new__

[issue23123] Only READ support for Decimal in json

2014-12-29 Thread Anders Rundgren
Anders Rundgren added the comment: Bob, I'm not sure I understand why you say that JCS requires *almost* full normalization. Using browsers you can generate fully compliant JCS objects using like 20 lines of javascript/webcrypto (here excluding base64 support). No normalization step

[issue23123] Only READ support for Decimal in json

2014-12-29 Thread Anders Rundgren
Anders Rundgren added the comment: The current JCS validator is only 150 lines and does both RSA and EC signatures: https://code.google.com/p/openkeystore/source/browse/python/trunk/src/org/webpki/json/JCSValidator.py My Java-version is much more advanced but this is quite useful anyway

[issue23123] Only READ support for Decimal in json

2014-12-29 Thread Anders Rundgren
Anders Rundgren added the comment: Ethan Furman added the comment: I am not a regular json user, but my impression is the format is pretty basic, and we would be overloading it to try and keep numbers with three decimal places as Decimal, and anything else as float. Isn't json's main

[issue23123] Only READ support for Decimal in json

2014-12-28 Thread Anders Rundgren
Anders Rundgren added the comment: I was actually hoping to implement the final part of this: https://openkeystore.googlecode.com/svn/resources/trunk/docs/jcs.html#Normalization_and_Signature_Validation It seems that the current Decimal implementation wouldn't save me anyway since it modifies

[issue23123] Only READ support for Decimal in json

2014-12-28 Thread Anders Rundgren
Anders Rundgren added the comment: It would be great if I could use a sub-classed Decimal during parsing but since it doesn't appear to be a way to serialize the result using the json package I'm probably stuck with the current 99% solution. I have solved this in Java and JavaScript

[issue23123] Only READ support for Decimal in json

2014-12-27 Thread Anders Rundgren
New submission from Anders Rundgren: jsonString = '{t:6,h:4.50, g:text,j:1.40e450}' jsonObject = json.loads(jsonString, object_pairs_hook=collections.OrderedDict,parse_float=Decimal) for item in jsonObject: print jsonObject[item] 6 4.50 text 1.40E+450 Works as expected. However, there seems

Re: Global indent

2014-08-23 Thread Anders Wegge Keller
On Sun, 24 Aug 2014 00:56:11 +1000 Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Despite my comments, I don't actually have any objection to people who choose to use Emacs, or Vim, or edit their text files by poking the hard drive platter with a magnetised needle if they prefer

Is there a tracker target for this mailing list?

2014-07-31 Thread Anders Wegge Keller
My spam filter have an issue with the way mails are sent to this list. If a mail sent to python-list is DKIM-signed, the DKIM-Signature header is kept in the mail. Since the mangling happening during distribution to the list changes one of the signed header fields, rather a lot of the mails to

Re: Is there a tracker target for this mailing list?

2014-07-31 Thread Anders Wegge Keller
On Thu, 31 Jul 2014 14:57:36 -0400 Terry Reedy tjre...@udel.edu wrote: On 7/31/2014 9:38 AM, Anders Wegge Keller wrote: My spam filter have an issue with the way mails are sent to this list. If a mail sent to python-list is DKIM-signed, the DKIM-Signature header is kept in the mail

Re: NaN comparisons - Call For Anecdotes

2014-07-15 Thread Anders J. Munch
. Is there a general numerics-list somewhere also? I don't see any on https://mail.python.org/mailman/listinfo. By the way, you guys seem to have overlooked the opportunity for arbitrage: *Anyone* can go to a numerical list, poll for examples, and come back and earn some beer :) regards, Anders

Re: Python 3 is killing Python

2014-07-15 Thread Anders Wegge Keller
Kevin Walzer k...@codebykevin.com writes: I can only think of two widely used languages in the last decade where there was this type of major break in binary compatibility: Perl and Visual Basic. Lua 5.1, 5.2 and 5.3 are all incompatible to some extent. It's debatable how widely used Lua is

Re: NaN comparisons - Call For Anecdotes

2014-07-14 Thread Anders J. Munch
. This is about float.__eq__, not about numpy or SciPy. Maybe they just don't like beer? regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

Re: NaN comparisons - Call For Anecdotes

2014-07-09 Thread Anders J. Munch
) regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

Re: NaN comparisons - Call For Anecdotes

2014-07-09 Thread Anders J. Munch
, time stamps, NoneType's, bools, floating-point floats and a thousand other things, then NaNs stand out as the values that have special algorithm-breaking magic. I gave an example of such an algorithm in an earlier reply to Chris. regards, Anders -- https://mail.python.org/mailman/listinfo

Re: NaN comparisons - Call For Anecdotes

2014-07-09 Thread Anders J. Munch
strategies to avoid NaNs ever being compared. I'll take that one step further and say that as long as NaN!=NaN, everyone should seek to avoid NaNs ever being compared. regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

Re: NaN comparisons - Call For Anecdotes

2014-07-09 Thread Anders J. Munch
== always doing an identity test before calling __eq__ solve your problem? If not, what would it take to solve your problem? It would not solve it. Two bitwise identical NaNs would still compare different. What would solve the problem is making identical NaNs compare equal. regards, Anders

Re: NaN comparisons - Call For Anecdotes

2014-07-09 Thread Anders J. Munch
on those lists read python-list also? regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

Re: NaN comparisons - Call For Anecdotes

2014-07-09 Thread Anders J. Munch
to improvement of Python, well, I'm not too optimistic, but I feel the point was worth making regardless. regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

NaN comparisons - Call For Anecdotes

2014-07-08 Thread Anders J. Munch
) that benefits from NaN!=NaN and that would fail if x==x for all float objects x, then please come forward and show it, and I'll buy you a beer the next time I'm at PyCon. regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

Re: NaN comparisons - Call For Anecdotes

2014-07-08 Thread Anders J. Munch
. regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

Re: NaN comparisons - Call For Anecdotes

2014-07-08 Thread Anders J. Munch
fully aware of that. Whether NaN's are one equivalence class or several is not the issue. What matters is the integrity of the equivalence relation. Following the standard isn't a good reason itself? If a standard tells you to jump of a cliff... regards, Anders -- https://mail.python.org

Re: NaN comparisons - Call For Anecdotes

2014-07-08 Thread Anders J. Munch
so. regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

Re: NaN comparisons - Call For Anecdotes

2014-07-08 Thread Anders J. Munch
Ethan Furman skrev: What exception? Apparently your claims about NaN in Python are all wrong -- have you been using a custom interpreter? float('inf') - float('inf') nan If you deliberately try to manufacture NaN's, you can. I never said otherwise. regards, Anders -- https://mail.python.org

Re: NaN comparisons - Call For Anecdotes

2014-07-08 Thread Anders J. Munch
with missing data. They generally want NaN propagated and not have some long running calculation crash in the middle. NaN!=NaN doesn't cause NaN's to propagate any more or any less. It simply causes a different branch of code to run, quite often the wrong one. regards, Anders -- https://mail.python.org

Re: NaN comparisons - Call For Anecdotes

2014-07-08 Thread Anders J. Munch
. regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] == on object tests identity in 3.x

2014-07-08 Thread Anders J. Munch
are different in those languages, so choices the IEEE-754 committee made with C and Fortran in mind may be less relevant for Python. regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

Re: Separate Address number and name

2014-01-21 Thread Anders Wegge Keller
Shane Konings shane.koni...@gmail.com writes: I have struggled with this for a while and know there must be a simple method to achieve this result. There are several. But without seeing the code you have already written, it's har to help you improve it. -- /Wegge Leder efter redundant

Re: Separate Address number and name

2014-01-21 Thread Anders Wegge Keller
Shane Konings shane.koni...@gmail.com writes: ... The following is a sample of the data. There are hundreds of lines that need to have an automated process of splitting the strings into headings to be imported into excel with theses headings ID Address StreetNum StreetName SufType Dir

Reference counting and the use of PYTHONDUMPREFS

2014-01-18 Thread Anders Wegge Keller
During the final test of a bit of embedded python, I wanted to see if I had any hanging references. To my suprise, I ended up with a rather large amount, after running combinerefs.py. And even with the simplest[1] possible use of embedding, I end up with 13475 still-living references. If this

[issue20288] HTMLParse handing of non-numeric charrefs broken

2014-01-17 Thread Anders Hammarquist
New submission from Anders Hammarquist: Python 2.7 HTMLParse.py lines 185-199 (similar lines still exist in Python 3.4) match = charref.match(rawdata, i) if match: ... else: if ; in rawdata[i:]: #bail

Re: grimace: a fluent regular expression generator in Python

2013-07-16 Thread Anders J. Munch
} $ ) It's too bad re.VERBOSE isn't the default. regards, Anders -- http://mail.python.org/mailman/listinfo/python-list

[issue15873] datetime cannot parse ISO 8601 dates and times

2013-03-09 Thread Anders Hovmöller
Anders Hovmöller added the comment: Éric Araujo: absolutely. Although I think my code can be improved (speed wise, elegance, etc) since I just wrote it quickly a weekend :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue15873] datetime cannot parse ISO 8601 dates and times

2013-03-07 Thread Anders Hovmöller
Anders Hovmöller added the comment: I've written a parser for ISO 8601: https://github.com/boxed/iso8601 Some basic tests are included and it supports most of the standard. Haven't gotten around to the more obscure parts like durations and intervals, but those are trivial to add

RE: Right solution to unicode error?

2012-11-08 Thread Anders Schneiderman
Thanks, Oscar and Ramit! This is exactly what I was looking for. Anders -Original Message- From: Oscar Benjamin [mailto:oscar.j.benja...@gmail.com] Sent: Wednesday, November 07, 2012 6:27 PM To: Anders Schneiderman Cc: python-list@python.org Subject: Re: Right solution to unicode

Right solution to unicode error?

2012-11-07 Thread Anders
the tasks' subjects, one of the tasks is generating an error: Traceback (most recent call last): File outlook_tasks.py, line 66, in module my_tasks.dump_today_tasks() File C:\Users\Anders\code\Task List\tasks.py, line 29, in dump_today_tasks print task.subject UnicodeEncodeError: 'ascii' codec

[issue15429] types.NoneType missing

2012-07-22 Thread Anders Kaseorg
Changes by Anders Kaseorg ande...@mit.edu: -- assignee: docs@python components: Documentation nosy: andersk, docs@python priority: normal severity: normal status: open title: types.NoneType missing type: behavior versions: Python 3.2 ___ Python

[issue15429] types.NoneType missing

2012-07-22 Thread Anders Kaseorg
New submission from Anders Kaseorg ande...@mit.edu: http://docs.python.org/py3k/library/constants.html#None says that None is the sole value type types.NoneType. However, NoneType was removed from the types module with Python 3. -- ___ Python

[issue15292] import hook behavior documentation improvement

2012-07-08 Thread Anders Hammarquist
New submission from Anders Hammarquist i...@iko.pp.se: When testing Eutaxia on PyPy (1.9) I discovered a discrepancy in the path_hooks import hook implementation. In CPython (2.7), if the find_module() method raises ImportError (as imp.find_module() does when it does not find a module

[issue10513] sqlite3.InterfaceError after commit

2012-02-16 Thread Anders Blomdell
Anders Blomdell anders.blomd...@control.lth.se added the comment: So my suggestion is to remove in pysql_connection_commit the call to : pysqlite_do_all_statements(self, ACTION_RESET, 0); to bring back the correct old behavior. That's what I have been running for years, now... And also

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2011-12-28 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: James: That’s not related to this issue. This issue is about options taking arguments beginning with dash (such as a2x --asciidoc-opts --safe, where --safe is the argument to --asciidoc-opts), not positional arguments beginning with dash

Calling JavaScript inside the webbrowser module

2011-10-30 Thread Anders Gunnarsson
Hi! Is there anyway to communicate with JavaScript inside a website opened via the webbrowser module? | import webbrowser | webbrowser.open('http://python.org') Here I'd like to do something like webbrowser.call('alert(1)') and I'd like to be able to call the python app from javascript too.

[issue12844] Support more than 255 arguments

2011-08-25 Thread Anders Kaseorg
New submission from Anders Kaseorg ande...@mit.edu: This feels like an arbitrary restriction (obvious sequences have been replaced with ‘…’ to save space in this report): zip([0], [1], [2], …, [1999]) File stdin, line 1 SyntaxError: more than 255 arguments especially when this works: zip

[issue12844] Support more than 255 arguments

2011-08-25 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: I guess the desugaring is slightly more complicated in the case where the original function call already used *args or **kwargs: f(arg0, …, arg999, *args, k0=v0, …, k999=v999, **kwargs) becomes something like f(*((arg0, …, arg999) + args

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Anders J. Munch
Thomas 'PointedEars' Lahn wrote: I am getting the idea here that you mean the right thing, but that you explain it wrong. Feel free to write the much longer essay that explains it all unambiguously, I'm not going to. regards, Anders -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Anders J. Munch
:) regards, Anders -- http://mail.python.org/mailman/listinfo/python-list

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2011-03-26 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: @andersk: Would the restriction to only having flags with a fixed number of arguments be acceptable for your use case? I think that’s fine. Anyone coming from optparse won’t need options with optional arguments. However, FWIW, GNU

[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus
New submission from Anders Østhus grapz...@gmail.com: Hi I'm running Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on win32 (Server 2008 R2). I've discovered that when moving files with shutil.move, the file won't inherit the security settings as it should

[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus
Anders Østhus grapz...@gmail.com added the comment: Ok, but the whole page you linked to (http://docs.python.org/library/shutil) confuses me then. It states at the top: Warning Even the higher-level file copying functions (copy(), copy2()) can’t copy all file metadata. On POSIX platforms

[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus
Anders Østhus grapz...@gmail.com added the comment: Ok. But that makes the whole method inconsistent. Basically, if it's on the same filesystem, rename the file, and thus not inheriting ACL. If it's on another use copy2, and inherit ACL. That makes no sense, atleast not to me

[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus
Anders Østhus grapz...@gmail.com added the comment: On my system (Win Server 2008 R2 64-Bit, Python 2.7.1), when I use copy, copy2 or move(to another filesystem), the file _will_ get the ACL of the DST folder, and remove any ACL in SRC file that the DST folder does not have. Thus, it doesn't

[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus
Anders Østhus grapz...@gmail.com added the comment: Thank you for taking the time to explain it to me, but it still seems inconsistent to me. I did a test with the functions copy, copy2, move, os.rename, copyfile, both on the same filesystem and another filesystem, and the result is: Same

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2011-02-06 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: There are some problems that ‘=’ can’t solve, such as options with nargs ≥ 2. optparse has no trouble with this: parser = optparse.OptionParser() parser.add_option('-a', nargs=2) parser.parse_args(['-a', '-first', '-second']) (Values

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2011-02-06 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: That would be a good first step. I continue to advocate making that mode the default, because it’s consistent with how every other command line program works[1], and backwards compatible with the current argparse behavior. As far

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2011-02-06 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: (1) It's only deprecated in the documentation Which is why I suggested un-deprecating it in the documentation. (I want to avoid encouraging programmers to switch away from optparse until this bug is fixed.) # proposed behavior parser

[issue1571170] Some numeric characters are still not recognized

2010-12-09 Thread Anders Chrigström
Anders Chrigström ander...@users.sourceforge.net added the comment: This is indeed a duplicate of #1571184 -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1571170

is py2exe still active ?

2010-12-07 Thread Anders Persson
Hi! When a look att py2exe homepage it is not looking like mutch happen, as a beginner i was thinking to start with Python 3, but i like to now if py2exe will be for 3 too. Is any one have any info ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Books recommendation

2010-12-07 Thread Anders Persson
You can't compile Python to exe files, but there is program packing your script to a exe files, look att www.py2exe.org Beware that you must have py2exe version match your pythonversion and att current time the highest version is 2.7. /A On Dec 7, 2:39 pm, Octavian Rasnita orasn...@gmail.com

[issue10513] sqlite3.InterfaceError after commit

2010-11-24 Thread Anders Blomdell
Anders Blomdell anders.blomd...@control.lth.se added the comment: The culprit seems to be 'pysqlite_do_all_statements(self, ACTION_RESET, 0)' in pysqlite_connection_commit, which resets all active statements, but subsequent fetch/fetchall seems to trash the sqlite3 state in the statements

[issue10513] sqlite3.InterfaceError after commit

2010-11-23 Thread Anders Blomdell
New submission from Anders Blomdell anders.blomd...@control.lth.se: With version 2.7 (and 2.7.1rc1), the following sequence (see attached test): c = cursor.execute(' select k from t where k == ?;', (1,)) conn.commit() r = c.fetchone() Traceback (most recent call last): File

[issue809163] Can't add files with spaces

2010-10-07 Thread Anders Sandvig
Changes by Anders Sandvig anders.sand...@gmail.com: -- nosy: +asandvig ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue809163 ___ ___ Python-bugs

[issue8595] Explain the default timeout in http-client-related libraries

2010-08-19 Thread Anders Sandvig
Changes by Anders Sandvig anders.sand...@gmail.com: -- nosy: +anders.sandvig ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8595 ___ ___ Python

[issue9641] httplib/ftplib: timeout parameter not applied correctly

2010-08-19 Thread Anders Sandvig
New submission from Anders Sandvig anders.sand...@gmail.com: From http://mail.python.org/pipermail/python-dev/2010-July/101266.html: Consider the following code for retreieving a web page using httplib: def get_url(hostname, port, url, timeout=5): con = httplib.HTTPConnection

[issue9641] httplib/ftplib: timeout parameter not applied correctly

2010-08-19 Thread Anders Sandvig
Anders Sandvig anders.sand...@gmail.com added the comment: The best (and simplest) solution seems to be option 2). Affected methods are found to be HTTPConnection.connect() and HTTPSConnection.connect() in Lib/httplib.py (Lib/http/client.py for 3.x) and FTP.connect() and FTP.ntransfercmd

[issue9641] httplib/ftplib: timeout parameter not applied correctly

2010-08-19 Thread Anders Sandvig
Anders Sandvig anders.sand...@gmail.com added the comment: socket.create_connection() does in fact set the timeout of the resulting socket object, so the issue is not an issue after all. The problems I experienced was a result of sending the timeout as the third parameter

[issue979407] urllib2 digest auth totally broken

2010-08-19 Thread Anders Sandvig
Changes by Anders Sandvig anders.sand...@gmail.com: -- nosy: +anders.sandvig ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue979407 ___ ___ Python

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-26 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: I still disagree. You're giving the parser ambiguous input. If a parser sees --foo --bar, and --foo is a valid option, but --bar is not, this is a legitimately ambiguous situation. There is no ambiguity. According to the way that every

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-26 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: arguments = *(positional-argument / option) [-- *(positional-argument)] positional-argument = string option = foo-option / bar-option foo-option = --foo string bar-option = --bar Er, obviously positional arguments before the first

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-23 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: Note that the negative number heuristic you're complaining about doesn't actually affect your code below. Yes it does: import argparse parser = argparse.ArgumentParser(prog='a2x') parser.add_argument('--asciidoc-opts', ... action

[issue8376] Tutorial offers dangerous advice about iterator s: “__iter__() can just return self”

2010-07-22 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: I don’t think that small change is good enough, if it is still the case that the only provided example is the dangerous one. It would be easy to clarify the differences between the classes: rl = test.ReverseList('spam') [c for c in rl] ['m

[issue8376] Tutorial offers dangerous advice about iterator s: “__iter__() can just return self”

2010-07-22 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: Antoine: That’s true. Amaury: See my original bug description (“This is reasonable advice for writing an iterator class, but terrible advice for writing a container class…”), and my other comments. There is nothing wrong with explaining how

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-22 Thread Anders Kaseorg
New submission from Anders Kaseorg ande...@mit.edu: Porting the a2x program to argparse from the now-deprecated optparse subtly breaks it when certain options are passed: $ a2x --asciidoc-opts --safe gitcli.txt $ ./a2x.argparse --asciidoc-opts --safe gitcli.txt usage: a2x [-h] [--version

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-22 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: Though in general I find argparse's default behavior more useful. I’m not sure I understand. Why is it useful for an option parsing library to heuristically decide, by default, that I didn’t actually want to pass in the valid option that I

[issue8376] Tutorial offers dangerous advice about iterator s: “__iter__() can just return self”

2010-04-12 Thread Anders Kaseorg
New submission from Anders Kaseorg ande...@mit.edu: The Python tutorial offers some dangerous advice about adding iterator behavior to a class: http://docs.python.org/tutorial/classes.html#iterators “By now you have probably noticed that most container objects can be looped over using

[issue8376] Tutorial offers dangerous advice about iterator s: “__iter__() can just return self”

2010-04-12 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: As an experienced Python programmer I am obviously aware that the tutorial is trying to teach how to make an iterator class, not how to make a container class. But the tutorial doesn’t make that *clear*. It should be much more explicit about

[issue8158] documentation of 'optparse' module incomplete

2010-03-16 Thread Simon Anders
New submission from Simon Anders and...@embl.de: The class optparse.OptionParser supports a number of useful keyword arguments to the initializer, which are not documented in the Python Standard Library documentation, here: http://docs.python.org/library/optparse.html This is a bit

[issue1759169] clean up Solaris port and allow C99 extension modules

2010-01-02 Thread anders musikka
anders musikka anders.musi...@gmail.com added the comment: Just wanted to chip in my $.02: Defining _XOPEN_SOURCE in the python headers causes problems for Solaris. It also causes problems for Ubuntu Linux. Because _XOPEN_SOURCE is defined, Python.h must included first in any program under

[issue6682] Default traceback does not handle PEP302 loaded modules

2009-08-11 Thread Anders Blomdell
New submission from Anders Blomdell anders.blomd...@control.lth.se: While trying to get a PEP302 import hook to function properly, I found that the default traceback picks up the wrong sourcecode for PEP302 loaded modules. The testcase pep302_traceback.py tries to emulate the behavior

Re: Q: finding distance between 2 time's

2009-05-31 Thread Anders J. Munch
with: file_age_in_seconds = time.time() - os.path.getmtime(filename) Only convert to local time for presentation. - Anders -- http://mail.python.org/mailman/listinfo/python-list

[issue5704] Command line option '-3' should imply '-t'

2009-04-05 Thread Simon Anders
New submission from Simon Anders sand...@fs.tum.de: The '-3' command line option in Python 2.6 is supposed to warn whenever encountering something that would throw an error in Python 3. Mixing of tabs and spaces has become illegal in Python 3. However, Python 2.6, called with '-3', passes

Downloading binary files - Python3

2009-03-21 Thread Anders Eriksson
I intended. Is downloading a binary file using: srcdata = urlopen(url).read() the best way? Is there some other way that would speed up the downloading? // Anders -- English is not my first or second language so any error or insult are done in the translation! Please correct my English so I may

Re: search speed

2009-01-31 Thread anders
Tanks everyone that spent time helping my, the help was great. Best regards Anders -- http://mail.python.org/mailman/listinfo/python-list

search speed

2009-01-30 Thread anders
hope someone understand my beginner question what i am looking for is somting like if file.findInFile(LF01): ... Is there any library like this ?? Best Regards Anders -- http://mail.python.org/mailman/listinfo/python-list

[issue2736] datetime needs and epoch method

2008-11-18 Thread Anders J. Munch
Anders J. Munch [EMAIL PROTECTED] added the comment: Any thoughts to time zone/DST handling for naive datetime objects? E.g. suppose the datetime object was created by .utcnow or .utcfromtimestamp. For aware datetime objects, I think the time.mktime(dt.timetuple()) approach doesn't work; the tz

Re: [NEWBIE] csv to excel format problem

2008-10-16 Thread Anders Eriksson
them out ;-) // Anders -- English is not my first, or second, language so anything strange, or insulting, is due to the translation. Please correct me so I may improve my English! On Tue, 14 Oct 2008 03:03:52 -0700 (PDT), MM wrote: Hi to all, I'm trying to import a tab separated values file

Re: I want to use a C++ library from Python

2008-09-11 Thread Anders Eriksson
the source code of the C++? I don't have the source code! Just the header files and the library and dll. Have I overlooked something or am I just screwed? // Anders -- English is not my first, or second, language so anything strange, or insulting, is due to the translation. Please correct me so I may

I want to use a C++ library from Python

2008-09-10 Thread Anders Eriksson
Hello, I have a C++ library compiled as Windows DLL's. It consists of 32 .h and 1 .lib and 1 .dll files. I don't have the source code. How can I create a Python module from these files? // Anders -- English is not my first, or second, language so anything strange, or insulting, is due

[issue1759845] subprocess.call fails with unicode strings in command line

2008-08-26 Thread Anders J. Munch
Changes by Anders J. Munch [EMAIL PROTECTED]: -- nosy: +andersjm ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1759845 ___ ___ Python-bugs-list mailing

[issue1220212] os.kill on windows

2008-08-25 Thread Anders J. Munch
Changes by Anders J. Munch [EMAIL PROTECTED]: -- nosy: +andersjm ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1220212 ___ ___ Python-bugs-list mailing

[issue3545] Python turning off assertions (Windows)

2008-08-14 Thread Anders Bensryd
Anders Bensryd [EMAIL PROTECTED] added the comment: We started using Python 2.5.2 recently and a few developers have complained that they do not get any assertions anymore so yes, we do use _ASSERT() and _ASSERTE(), but after a brief look it seems as if we mainly use assert(). The developer

[issue3545] Python turning off assertions (Windows)

2008-08-13 Thread Anders Bensryd
Anders Bensryd [EMAIL PROTECTED] added the comment: Yes, we could do that. However, my concerns are: 1) We cannot be the only Python user that experience this issue? I would prefer one of these solutions (in this order): a) A parameter to Py_Initialize (structure) that controls its behaviour

[issue3545] Python turning off assertions (Windows)

2008-08-12 Thread Anders Bensryd
New submission from Anders Bensryd [EMAIL PROTECTED]: We are using Windows XP SP2, Visual Studio 2005 Python 2.5.2. In Objects/exceptions.c the following code turns off all assertions. #if defined _MSC_VER _MSC_VER = 1400 defined(__STDC_SECURE_LIB__) /* Set CRT argument error handler

Re: Boolean tests

2008-08-01 Thread Anders J. Munch
read the rest of the paragraph. Of course I know what __nonzero__ does. regards, Anders -- http://mail.python.org/mailman/listinfo/python-list

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Anders J. Munch
Steven D'Aprano wrote: On Tue, 29 Jul 2008 00:23:02 +, Steven D'Aprano wrote: Dude. Dude. Just... learn some Python before you embarrass yourself further. I'm sorry Anders, that was a needlessly harsh thing for me to say. I apologize for the unpleasant tone. Still, __nonzero__

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-28 Thread Anders J. Munch
is simple to type, but not so simple to read. if x.namedPredicate() is harder to type, but easier to read. I prefer the latter because code is read more often than it is written. regards, Anders -- http://mail.python.org/mailman/listinfo/python-list

Re: Rant (was Re: x*x if x10

2008-07-27 Thread Anders J. Munch
Gary Herron wrote: A = [1,2,3] B = [4,5,6] C = [7,8,9] A+B+C [1, 2, 3, 4, 5, 6, 7, 8, 9] sum([A,B,C], []) [1, 2, 3, 4, 5, 6, 7, 8, 9] Careful now, this can be very slow. sum uses __add__, not __iadd__, which gives this approach quadratic worst-case runtime. - Anders -- http

Re: Recursion Performance Question

2008-07-24 Thread Anders J. Munch
= [] gwl_helper(node, hwnd, result.append) return result - Anders -- http://mail.python.org/mailman/listinfo/python-list

Re: List all files using FTP

2008-03-07 Thread Anders Eriksson
On Thu, 6 Mar 2008 20:07:46 +, Simon Brunning wrote: This might be of use: http://ftputil.sschwarzer.net/trac Nice, Just what I needed! Thank you! // Anders -- English is not my first, or second, language so anything strange, or insulting, is due to the translation. Please correct me

List all files using FTP

2008-03-06 Thread Anders Eriksson
Hello, I need to list all the files on my FTP account (multiple subdirectories). I don't have shell access to the account. anyone that has a program that will do this? // Anders -- English is not my first, or second, language so anything strange, or insulting, is due to the translation. Please

<    1   2   3   >