Re: Configuring an object via a dictionary

2024-03-18 Thread Anders Munch via Python-list
self.conf = Settings(**config) regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2022-03-26 Thread Anders Kaseorg
Anders Kaseorg added the comment: It could and does, as quoted in my original report. Content-Type: text/plain; charset*=utf-8”''utf-8%E2%80%9D That’s a U+201D right double quotation mark. This is not a valid charset for the charset of course, but it seems like the code was intended

[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Anders Hovmöller
Anders Hovmöller added the comment: For `foo(a, /, b)`, it could be: "TypeError: foo() missing 1 required argument 'a', and one required positional argument 'b'. If we start on this road there are some more, like for `def foo(a, *, b)` you get the error "TypeError: foo() missing

[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Anders Hovmöller
Anders Hovmöller added the comment: Just dropping the word "positional" is very good. That word is a lie, and just removing it makes it true. -- ___ Python tracker <https://bugs.python.o

[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Anders Hovmöller
New submission from Anders Hovmöller : >>> def foo(a): ... pass ... >>> foo() Traceback (most recent call last): File "", line 1, in TypeError: foo() missing 1 required positional argument: 'a' This error is incorrect. It says "positional argument"

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

2022-01-12 Thread Anders Kaseorg
Anders Kaseorg added the comment: > While optparse that it isn't being developed further, therebut will not > be taken away. IIRC the reason for this was that it too had become > difficult to build out and that is what necessitated the creation of > argparse -- there wasn't clea

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

2021-12-26 Thread Anders Kaseorg
Anders Kaseorg added the comment: If argparse will not be developed further to fix this bug, then we should undo the deprecation of optparse in the documentation (https://bugs.python.org/issue37103), since the stated justification for that deprecation was that optparse will not be developed

Create a contact book

2021-10-26 Thread anders Limpan
i would like to create a contact book were you can keep track of your friends. With this contact book you will both be able to add friends and view which friends that you have added. anyone interested in helping me out with this one ?=) -- https://mail.python.org/mailman/listinfo/python-list

[issue44967] pydoc should return non-zero exit code when a query is not found

2021-08-20 Thread Gregory Anders
Change by Gregory Anders : -- keywords: +patch pull_requests: +26323 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27868 ___ Python tracker <https://bugs.python.org/issu

[issue44967] pydoc should return non-zero exit code when a query is not found

2021-08-20 Thread Gregory Anders
New submission from Gregory Anders : Currently pydoc returns an exit code of zero no matter what, even with e.g. pydoc lsjdfkdfj However, the ability to know whether or not pydoc successfully found a result is useful in tools that embed pydoc in some way. Here's one use case: Vim

[issue44680] Reference cycles from a WeakKeyDictionary value to its key aren’t collected

2021-07-19 Thread Anders Kaseorg
Anders Kaseorg added the comment: > extra_states[o] = ExtraState(obj) (Typo for extra_states[obj] = ExtraState(obj), obviously.) -- ___ Python tracker <https://bugs.python.org/issu

[issue44680] Reference cycles from a WeakKeyDictionary value to its key aren’t collected

2021-07-19 Thread Anders Kaseorg
New submission from Anders Kaseorg : Because WeakKeyDictionary unconditionally maintains strong references to its values, the garbage collector fails to collect a reference cycle from a WeakKeyDictionary value to its key. For example, the following program unexpectedly leaks memory: from

[issue44283] Add jump table for certain safe match-case statements

2021-06-07 Thread Anders Munch
Anders Munch added the comment: Are you sure you want to do this? This optimisation is not applicable if the matched values are given symbolic names. You would be encouraging people to write bad code with lots of literals, for speed. -- nosy: +AndersMunch

[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2021-02-25 Thread Anders Kaseorg
New submission from Anders Kaseorg : We ran into a UnicodeEncodeError exception using email.parser to parse this email <https://lists.cam.ac.uk/pipermail/cl-isabelle-users/2021-February/msg00135.html>, with full headers available in the raw archive <https://lists.cam.ac.uk/pip

[issue43115] locale.getlocale fails if locale is set

2021-02-23 Thread Anders Munch
Anders Munch added the comment: >> What does use getlocale is time.strptime and datetime.datetime.strptime, so >> when getlocale fails, strptime fails. > Would they work with getlocale() returning None for the encoding ? Yes. All getlocale is used for in _strptime.py is comp

[issue43115] locale.getlocale fails if locale is set

2021-02-17 Thread Anders Munch
Anders Munch added the comment: > BTW: What is wxWidgets doing with the returned values ? wxWidgets doesn't call getlocale, it's a C++ library (wrapped by wxPython) that uses C setlocale. What does use getlocale is time.strptime and datetime.datetime.strptime, so when getlocale fa

[issue43115] locale.getlocale fails if locale is set

2021-02-17 Thread Anders Munch
Anders Munch added the comment: getlocale is documented to return None for the encoding if no encoding can be determined. There's no need to guess. I can't change the locale.setlocale call, because where I'm actually having the problem, I'm not even calling locale.setlocale: wxWidgets

[issue43115] locale.getlocale fails if locale is set

2021-02-17 Thread Anders Munch
Anders Munch added the comment: I discovered that this can happen with underscores as well: Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license"

[issue43115] locale.getlocale fails if locale is set

2021-02-03 Thread Anders Munch
New submission from Anders Munch : getlocale fails with an exception when the string returned by _setlocale is already an RFC 1766 language tag. Example: Python 3.10.0a4 (tags/v3.10.0a4:445f7f5, Jan 4 2021, 19:55:53) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyr

[issue37909] Thread pool return ref hold memory

2020-01-21 Thread Anders
Anders added the comment: Note: due to a change in Python 3.8 this example would be a lot less noticeable if tested. The problem remains the same though. If you run this snippet with Python 3.7, which is before the thread reuse was introduced into the ThreadPoolExecutor, each thread

[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2020-01-20 Thread Anders Hovmöller
Anders Hovmöller added the comment: We were also bitten by this. In fact we still run a compatibility shim in production where we log if the new and old behavior are different. We also didn't think this "bug fix" made sense or was treated with the appropriate gravity in the rel

[issue38673] REPL shows continuation prompt (...) when comment or space entered

2019-11-07 Thread Anders Lorentsen
Anders Lorentsen added the comment: As a person without much experience, it sounded like a simple enough task, but having dug a bit, I found it quite complicated. It seems to me that the interpreter loop (in the standard REPL, that you get when you start ./python, blocks for input somewhere

Re: Recursive method in class

2019-09-30 Thread Anders Märak Leffler
... return 999 ... >>> instance.factorial(5) # Where will the call go ("old" or "new" >>> factorial?)? Where will possible recursive calls go (and why)? Hello! 4995 Oh, and as others have pointed out on this list - you/whoever runs the system sending the

[issue31956] Add start and stop parameters to the array.index()

2019-09-15 Thread Anders Lorentsen
Anders Lorentsen added the comment: I have actually managed to lost my local branch of this fix, though I assume I can just start another one, manually copy over the changes, somehow mark this current PR as cancelled, aborted, or in my option the best: "replaced/superseeded by: [n

[issue31956] Add start and stop parameters to the array.index()

2019-08-27 Thread Anders Lorentsen
Anders Lorentsen added the comment: As far as I can recall, the patch is generally speaking good to go. A number of discussions arose on various details, however. In any event, I'll take a look at it during the next few days. -- ___ Python

[issue37103] Undo deprecation of optparse

2019-05-30 Thread Anders Kaseorg
New submission from Anders Kaseorg : The optparse library is currently marked in the documentation as deprecated in favor of argparse. However, argparse uses a nonstandard reinterpretation of Unix command line grammars that makes certain arguments impossible to express, and causes scripts

[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2019-04-12 Thread Anders Hovmöller
Anders Hovmöller added the comment: That might be true, but that seems like a weak argument. If anything, it means those others are broken. What is the logic behind "(.*)" returning the entire string (which is what you asked for) and exactly one empty string? Why not two empty str

[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2019-04-11 Thread Anders Hovmöller
Anders Hovmöller added the comment: Just as a comparison, sed does the 3.6 thing: > echo foo | sed 's/\(.*\)/x\1y/g' xfooy -- ___ Python tracker <https://bugs.python.org/issu

[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2019-04-11 Thread Anders Hovmöller
Anders Hovmöller added the comment: This was a really bad idea in my opinion. We just found this and we have no way to know how this will impact production. It's really absurd that re.sub('(.*)', r'foo', 'asd') is "foo" in python 1 to 3.6 but 'foofoo' in python 3.7. -

[issue36485] Add a way to clear all caches

2019-03-31 Thread Anders Hovmöller
Anders Hovmöller added the comment: I think this is a great idea. We would have needed this many times for tests over the years. -- nosy: +Anders.Hovmöller ___ Python tracker <https://bugs.python.org/issue36

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2019-03-22 Thread Anders Hovmöller
Anders Hovmöller added the comment: I just discovered this ticket again and see that it's stuck! I have read through the thread but it's still a bit unclear what would be required to test this with homebrew like Guido says is needed for this to go forward. Is there anyone who can explain

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

2018-12-12 Thread Anders Kaseorg
Anders Kaseorg added the comment: porton: Please don’t steal someone else’s issue to report a different bug. Open a new issue instead. -- title: argparse: add a full fledged parser as a subparser -> argparse does not accept options taking arguments beginning with dash (regress

Re: PEP 394

2018-10-20 Thread Anders Wegge Keller
På Sat, 20 Oct 2018 12:57:45 +1100 Ben Finney skrev: > Anders Wegge Keller writes: > > > Short and simple: Do you expect PEP 394 to change status > > The status of PEP 394 today is “Active”. What change of status would you > expect in this Informational PEP? One

Re: logging output

2018-10-19 Thread Anders Wegge Keller
På Fri, 19 Oct 2018 08:05:28 -0700 (PDT) Sharan Basappa skrev: ... > delimiter=r'\s"') #data_df = pd.read_csv("BGL_MERGED.log") > logger.debug("data frame %s \n", data_df) Do this help? -- //Wegge --

PEP 394

2018-10-19 Thread Anders Wegge Keller
Short and simple: Do you expect PEP 394 to change status or recommendation when official support for Python2 ends in 13½ months time, or at least some time thereafter? For those that don't have the habit of memorizing PEPs, 394 is the one stating * python2 will refer to some version of Python

[issue34861] Improve cProfile standard output

2018-10-07 Thread Anders Hovmöller
Anders Hovmöller added the comment: Output before this patch: 3666 function calls (3556 primitive calls) in 0.005 seconds Ordered by: standard name ncalls tottime percall cumtime percall filename:lineno(function) 20.0000.0000.0020.001 :1009

[issue34861] Improve cProfile standard output

2018-10-05 Thread Anders Hovmöller
Anders Hovmöller added the comment: There is an example output on github. Should I paste it here too? I can do it once I get home if you want. -- ___ Python tracker <https://bugs.python.org/issue34

[issue34861] Improve cProfile standard output

2018-10-01 Thread Anders Hovmöller
Change by Anders Hovmöller : -- keywords: +patch pull_requests: +9046 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34861> ___ ___ Py

[issue34861] Improve cProfile standard output

2018-10-01 Thread Anders Hovmöller
New submission from Anders Hovmöller : The standard output for cProfile when run from a command line is not very useful. It has two main flaws: - Default sort order is by name of function - It strips the full path of source files The first makes it very hard to look at the output. The second

Re: Non-GUI, single processort inter process massaging - how?

2018-07-23 Thread Anders Wegge Keller
På Sat, 21 Jul 2018 09:07:23 +0100 Chris Green skrev: > So - what's the best approach to this? I've done some searching and > most/many of the solutions seem rather heavyweight for my needs. Am I > overlooking something obvious or should I try rethinking the original > requirement and look for

Re: Unicode [was Re: Cult-like behaviour]

2018-07-16 Thread Anders Wegge Keller
På Mon, 16 Jul 2018 11:33:46 -0700 Jim Lee skrev: > Go right ahead.  I find it surprising that Stephen isn't banned, > considering the fact that he ridicules anyone he doesn't agree with.  > But I guess he's one of the 'good 'ol boys', and so exempt from the code > of conduct. Well said! --

Re: Unicode [was Re: Cult-like behaviour]

2018-07-16 Thread Anders Wegge Keller
> The buzzing noise you just heard was the joke whizzing past your head > *wink* I have twins aged four. They also like to yell "I cheated!", whenever they are called out. In general, you need to get rid of tat teenage brat persona you practice. The "ranting rick" charade was especially

Re: Sorting NaNs

2018-06-11 Thread Anders Munch
Steven D'Aprano: It is not a guess if the user explicitly specifies that as the behaviour. If that was the context, sure, no problem. - Anders -- https://mail.python.org/mailman/listinfo/python-list

Re: Sorting NaNs

2018-06-10 Thread Anders Munch
NaN as a 'No Data' placeholder). 3) Raise an exception. I can't believe anyone even suggested 2).  "In the face of ambiguity, refuse the temptation to guess." regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

Re: object types, mutable or not?

2018-05-17 Thread Anders Wegge Keller
På Wed, 16 May 2018 14:48:27 +0100 Paul Moore skrev: > C++ called that an "rvalue". And then went on to define things that > could go on the left hand side of an assignment as "lvalues". And now > we have two confusing concepts to explain - see what happens when you > let a

Re: want to export some of the packets from a big pacp file to another file.

2018-04-05 Thread Anders Wegge Keller
På Thu, 5 Apr 2018 08:06:10 -0700 (PDT) supsw...@gmail.com skrev: > Hi, > > I am using dpkt python package to parse .pcap file and I am able to do > successfully. > > My requirement is to filter some of the traffic from the big .pcap file > and to export the result to another file. > > I don't

Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Anders Wegge Keller
På Sat, 31 Mar 2018 11:58:39 -0400 Etienne Robillard skrev: > Are you trolling? Do you understand that a modern mobile device > typically require a Internet subscription and an additional subscription > for the smart phone? I think the question is why you equate python3

[issue33143] encode UTF-16 generates unexpected results

2018-03-26 Thread Anders Rundgren
Anders Rundgren <anders.rundgren@gmail.com> added the comment: Thanx for the superquick response! I really appreciate it. I'm obviously a Python n00b Anders -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue33143] encode UTF-16 generates unexpected results

2018-03-26 Thread Anders Rundgren
New submission from Anders Rundgren <anders.rundgren@gmail.com>: Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-20 Thread Anders Wegge Keller
På Tue, 20 Feb 2018 12:28:25 + (UTC) Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> skrev: > On Mon, 19 Feb 2018 16:34:29 +0100, Anders Wegge Keller wrote: > > > På Mon, 19 Feb 2018 15:15:19 + (UTC) Steven D'Aprano > > <steve+comp.lang.pyt...@pearwood

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Anders Wegge Keller
På Mon, 19 Feb 2018 15:15:19 + (UTC) Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> skrev: > On Mon, 19 Feb 2018 14:06:36 +0100, Anders Wegge Keller wrote: > > > Array is not even close to providing a strongly typed container. > > That's a mighty powerful

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Anders Wegge Keller
På Mon, 19 Feb 2018 04:39:31 + (UTC) Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> skrev: > On Mon, 19 Feb 2018 04:26:32 +0100, Anders Wegge Keller wrote: > > > På Mon, 19 Feb 2018 08:47:14 +1100 > > Tim Delaney <timothy.c.dela...@gmail.com> skrev: >

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-18 Thread Anders Wegge Keller
På Mon, 19 Feb 2018 08:47:14 +1100 Tim Delaney <timothy.c.dela...@gmail.com> skrev: > On 18 February 2018 at 22:55, Anders Wegge Keller <we...@wegge.dk> wrote: > > That list is not only weakly typed, but rather untyped. There are no > > safeguards in the language, tha

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-18 Thread Anders Wegge Keller
På Sun, 18 Feb 2018 07:34:03 -0500 Richard Damon skrev: > Python is much stronger typed than PHP, because in PHP you can do things > like 1 + '2' and get 3, as string values will naturally convert > themselves to numbers, Python won't do this. Yes Python will freely

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-18 Thread Anders Wegge Keller
På Sat, 17 Feb 2018 15:05:34 +1100 Ben Finney skrev: > boB Stepp writes: > He blithely conflates “weakly typed” (Python objects are not weakly, but > very strongly typed) Python is more strongly typed than PHP, but that doesn't really say

[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-06 Thread Anders Lorentsen
Anders Lorentsen <pha...@gmail.com> added the comment: What do you mean "is a bug", and "the PR would encourage this"? Can't it be fixed? Are you saying that just because it is a bug now, we should be discouraged from making it work in the way you'd expect it to

[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-05 Thread Anders Lorentsen
Anders Lorentsen <pha...@gmail.com> added the comment: > # runs this weird file > subprocess.run([bin]) > # Currently an error; if this is implemented, would run > # /bin/ls, and pass it the -l argument. Refers to something > # completely different than our .exist

[issue32764] Popen doesn't work on Windows when args is a list

2018-02-04 Thread Anders Lorentsen
Anders Lorentsen <pha...@gmail.com> added the comment: Wait a minute. The failing test is test_nonexisting_with_pipes, and it fails because args[0] is a tuple - how can that be? Nobody is supposed to pass cmd=sequence-where-first-element-is-a-tuple! Is everything all right with th

[issue32764] Popen doesn't work on Windows when args is a list

2018-02-04 Thread Anders Lorentsen
Anders Lorentsen <pha...@gmail.com> added the comment: Also, isn't there continuous integration testing? Everything passed on the PR, so where does this come from? -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32764] Popen doesn't work on Windows when args is a list

2018-02-04 Thread Anders Lorentsen
Anders Lorentsen <pha...@gmail.com> added the comment: This is strange, because _execute_child calls os.fsdecode with `args` as the argument, which may be a list. os.fsdecode calls fspath. Now, the python docstring of _fspath, as defined in Lib/os.py on line 1031, clearly

[issue32601] PosixPathTest.test_expanduser fails in NixOS build sandbox

2018-01-19 Thread Anders Kaseorg
New submission from Anders Kaseorg <ande...@mit.edu>: PosixPathTest.test_expanduser fails in the NixOS build sandbox, where every user has home directory /, so it falls off the end of the for pwdent in pwd.getpwall() loop. nixbld:x:30001:3:Nix build user:/:/noshell nobody:x:65534

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2017-11-25 Thread Anders Hovmöller
Change by Anders Hovmöller <bo...@killingar.net>: -- nosy: +Anders.Hovmöller ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2017-11-25 Thread Anders Hovmöller
Change by Anders Hovmöller <bo...@killingar.net>: -- versions: +Python 3.6 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue22490> ___

[issue31956] Add start and stop parameters to the array.index()

2017-11-13 Thread Anders Lorentsen
Anders Lorentsen <pha...@gmail.com> added the comment: Writing my tests, I originally looked at Lib/test/seq_tests.py. One test case uses indexes that are (+-)4*sys.maxsize. This does not fit in Py_ssize_t, and so these tests cause my array implementation to raise an overflow exc

[issue31956] Add start and stop parameters to the array.index()

2017-11-12 Thread Anders Lorentsen
Anders Lorentsen <pha...@gmail.com> added the comment: I decided to work on this, and I would like some review, as this would be my second contribution to cpython. Also, a general question: As I defined the start and end arguments Py_ssize_t, bigger indexes (more negative or more po

[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2017-11-07 Thread Anders Lorentsen
Anders Lorentsen <pha...@gmail.com> added the comment: While researching this, I discovered that on MS Windows >>> subprocess.run([pathlike_object, additional_arguments]) did not run like it did on Posix. My PR includes this probl

[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2017-11-06 Thread Anders Lorentsen
Anders Lorentsen <pha...@gmail.com> added the comment: I was able to make a test that reproduces your code, and expectedly fails. Also implemented a fix for it. See a temporary diff here: https://pastebin.com/C9JWkg0i However, there is also a specific MS Windows version of _execute

[issue31843] sqlite3.connect() should accept PathLike objects

2017-11-06 Thread Anders Lorentsen
Anders Lorentsen <pha...@gmail.com> added the comment: Had my first go at a python patch. Added a test case for it, and all tests passing when I test with `./python -bb -E -Wd -m test -v test.test_sqlite -r -w -uall -R 3:2` -- nosy: +

Re: SIGSEGV and SIGILL inside PyCFunction_Call

2017-07-20 Thread Anders Wegge Keller
På Thu, 20 Jul 2017 07:44:26 +0200 dieter <die...@handshake.de> skrev: > Anders Wegge Keller <we...@wegge.dk> writes: ... >> Weird observation #1: Sometimes the reason is SIGSEGV, sometimes it's >> SIGILL. > Python tends to be sensitive to the stack size. I

SIGSEGV and SIGILL inside PyCFunction_Call

2017-07-19 Thread Anders Wegge Keller
I have an ongoing issue with my usenet setup. I'm that one dude who don't want to learn perl. That means that I have to build inn from source, so I can enable the python interpreter. That's not so bad, and the errors that show up have been something that I have been able to figure out by myself.

Re: Grapheme clusters, a.k.a.real characters

2017-07-18 Thread Anders Wegge Keller
På Tue, 18 Jul 2017 11:27:03 -0400 Dennis Lee Bieber skrev: > Probably would have to go to words predating the Roman occupation > (which probably means a dialect closer to Welsh or other Gaelic). > Everything later is an import (anglo-saxon being germanic tribes

Re: Grapheme clusters, a.k.a.real characters

2017-07-18 Thread Anders Wegge Keller
På Tue, 18 Jul 2017 23:59:33 +1000 Chris Angelico skrev: > On Tue, Jul 18, 2017 at 11:11 PM, Steve D'Aprano >> (I don't think any native English words use a double-V or double-U, but >> the possibility exists.) > vacuum. That's latin. -- //Wegge --

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2017-04-18 Thread Anders Hovmöller
Anders Hovmöller added the comment: @larsonreever That lib is pretty limited, in that it doesn't handle dates or deltas. Again: my lib that is linked above does and has comprehensive tests. -- ___ Python tracker <rep...@bugs.python.org>

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

2016-10-14 Thread Anders Kaseorg
Anders Kaseorg added the comment: Usui, this is a tutorial intended for beginners. Even if the change from “most” to “built-in” were a relevant one (and I don’t see how it is), beginners cannot possibly be expected to parse that level of meaning out of a single word. The difference between

Re: Python slang

2016-08-10 Thread Anders J. Munch
Lawrence D’Oliveiro: >> [...] as much like C++ as >> possible. > > Nevertheless, Python copied the C misfeature [...] You segued a little too easily from C++ to C. When talking language evolution and inspirations, they are entirely different things. - Anders -- https://mail.

Re: Python slang

2016-08-07 Thread Anders J. Munch via Python-list
rms. It was only later that language designers fell into the notion that it was crucial for a new language's success to look as much like C++ as possible. regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

[issue27623] int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero

2016-07-29 Thread Anders Lorentsen
Anders Lorentsen added the comment: I updated my patch to account for that second corner case. But ideally, shouldn't it rather be accounted for in the function that does the actual conversion, that is, in _PyLong_AsByteArray? -- Added file: http://bugs.python.org/file43942

[issue27623] int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero

2016-07-28 Thread Anders Lorentsen
Anders Lorentsen added the comment: So, am I to understand that the only corner case we should fix is that >>> (-1).to_bytes(0, 'big', signed=True) should raise an overflow error (currently it returns b'') ? -- Added file: http://bugs.python.org/

[issue27623] int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero

2016-07-27 Thread Anders Lorentsen
Anders Lorentsen added the comment: Isn't it possible to just add a small line of code that checks if length is less than or equal to 0, and if it is, call the necessary c functions to have python raise a valueerror...? Sorry if this is giving a solution without actually submitting the patch

[issue27623] int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero

2016-07-27 Thread Anders Lorentsen
Changes by Anders Lorentsen <pha...@gmail.com>: -- nosy: +Phaqui ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27623> ___ __

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-07-19 Thread Anders Hovmöller
Anders Hovmöller added the comment: Hmm, ok. I guess I was confused by "dates and times" part of the subject. Ok, so only datetimes. My other comments still apply though. > On 19 Jul 2016, at 16:20, Mathieu Dupuy <rep...@bugs.python.org> wrote: > > > Mat

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-07-19 Thread Anders Hovmöller
Anders Hovmöller added the comment: The tests attached to this ticket seem pretty bare. Issues that I can spot directly: - only tests for datetimes, not times or dates - only tests for zulu and "-8:00” timezones - no tests for invalid input (parsing a valid date as a datetime for ex

[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2016-07-19 Thread Anders Hovmöller
Anders Hovmöller added the comment: > The `arrow` library depends on the supposed "strict" behaviour of strptime > that has never been guaranteed, which often results in very buggy behaviour > under some conditions. Well… the arrow library accepts all sorts of broken

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-07-02 Thread Anders Hovmöller
Anders Hovmöller added the comment: > > By the way, I just discovered, that the way we treat microseconds differs > from the strptime one : we are smarter read every digits and smartly round to > six, strptime doesn't go that far and just *truncate* to this. Should go

Re: sobering observation, python vs. perl

2016-03-19 Thread Anders J. Munch
'release_req', so my results may be misleading. Perhaps you'll try it and post your results? regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-03-02 Thread Anders Wegge Keller
On Mon, 29 Feb 2016 23:29:43 + Mark Lawrence wrote: > On 29/02/2016 22:40, Larry Martell wrote: >> I think for the most part, the mental health industry is most >> interested in pushing drugs and forcing people into some status quo. > I am disgusted by your

[issue26229] Make number serialization ES6/V8 compatible

2016-02-02 Thread Anders Rundgren
Anders Rundgren added the comment: In ES6/V8-compatible implementations which include "node.js", Chrome, Firefox, Safari and (of course) my Java reference implementation you can take a cryptographic hash of a JSON object with a predictable result. That is, this request is in no w

[issue26229] Make number serialization ES6/V8 compatible

2016-02-02 Thread Anders Rundgren
Anders Rundgren added the comment: An easier fix than mucking around in the pretty complex number serializer code would be adding an "ES6Format" option to the "json.dump*" methods which could use the supplied conversion code as is. For JSON parsing in an ES6-compatible way

[issue26229] Make number serialization ES6/V8 compatible

2016-01-30 Thread Anders Rundgren
Anders Rundgren added the comment: As I said, the problem is close to fixed in 3.5. You should not consider the JCS specification as the [sole] target but the ability to creating a normalized JSON object which has many uses including calculating a hash of such objects

[issue26241] repr() and str() are identical for floats in 3.5

2016-01-30 Thread Anders Rundgren
New submission from Anders Rundgren: According to the documentation repr() and str() are different when it comes to number formatting. A test with a 100 million random and selected IEEE 64-bit values returned no differences -- components: Interpreter Core messages: 259244 nosy

[issue26241] repr() and str() are identical for floats in 3.5

2016-01-30 Thread Anders Rundgren
Anders Rundgren added the comment: Apparently the docs have changed since 2.7: https://docs.python.org/3.5/tutorial/floatingpoint.html However, the documentation still "sort of" mentions repr() as the most accurate form which isn't entirely correct since it nowadays is identi

[issue26229] Make number serialization ES6/V8 compatible

2016-01-27 Thread Anders Rundgren
New submission from Anders Rundgren: ECMA has in their latest release defined that JSON elements must be ordered during serialization. This is easy to accomplish using Python's OrderedDict. What is less trivial is that numbers have to be formatted in a certain way as well. I have tested

[issue26191] pip on Windows doesn't honor Case

2016-01-24 Thread Anders Rundgren
New submission from Anders Rundgren: pip install Crypto Terminates correctly and the package is there as well. Unfortunately the directory is named "crypto" rather than "Crypto" so when I perform >>>import Crypto the interpreter fails. >>>import cryp

Parsing and displaying C structs in a semi-intelligent way.

2015-07-17 Thread Anders Wegge Keller
In my day job, we have a large code base of mostly identical projects, each with their own customizations. The customizations can be a real pain sometimes. Especially when debugging binary data. The interesting part of the binary dumps are most often the stuff that are tweaked from project to

Hello Group and how to practice?

2015-05-31 Thread Anders Johansen
Hi my name is Anders I am from Denmark, and I am new to programming and python. Currently, I am doing the codecademy.com python course, but sometime I feel that the course advances to fast and I lack repeating (practicing) some of the concepts, however I don't feel confident enough to start

Re: Hello Group and how to practice?

2015-05-31 Thread Anders Johansen
Den søndag den 31. maj 2015 kl. 16.22.10 UTC+2 skrev Cem Karan: On May 31, 2015, at 9:35 AM, Anders Johansen sko...@gmail.com wrote: Hi my name is Anders I am from Denmark, and I am new to programming and python. Currently, I am doing the codecademy.com python course, but sometime I

[issue23123] Only READ support for Decimal in json

2014-12-30 Thread Anders Rundgren
Anders Rundgren added the comment: Antoine Pitrou added the comment: To cope with this potential problem, compliant parsers must preserve the original textual representation of properties internally in order to support JCS normalization requirements That sounds ridiculous. Did someone

[issue23123] Only READ support for Decimal in json

2014-12-30 Thread Anders Rundgren
Anders Rundgren added the comment: Antoine Pitrou added the comment: I won't claim to know/understand the specifics, but message payload in base64 actually sounds reasonable to me, if far from optimal (both from readibility and space overhead POV) :-). It is indeed a working solution

[issue23123] Only READ support for Decimal in json

2014-12-29 Thread Anders Rundgren
Anders Rundgren added the comment: I guess my particular requirement/wish is unusual (keeping the original textual representation of a floating point number intact) while using Decimal should be fairly universal. If these things could be combined in a Decimal support option I would

[issue23123] Only READ support for Decimal in json

2014-12-29 Thread Anders Rundgren
Anders Rundgren added the comment: Bob, Your'e right, I have put up a requirement for JSON serializing that may be over the top. OTOH, there are (AFAICT...) only two possible solutions: 1. Outlaw floating point data from the plot 2. Insist that serializers conform to the spec As a pragmatic I

  1   2   3   >