New submission from paul rubin <[EMAIL PROTECTED]>:
For object serialization and some other purposes, Java encodes unicode
strings with a modified version of utf-8:
http://en.wikipedia.org/wiki/UTF-8#Java
http://java.sun.com/javase/6/docs/api/java/io/DataInput.html#modified-utf-8
It is u
paul rubin <[EMAIL PROTECTED]> added the comment:
Some java applications use it externally. The purpose seems to be to
prevent NUL bytes from appearing inside encoded strings which can
confuse C libraries that expect NUL's to terminate strings. My
immediate application is par
paul rubin <[EMAIL PROTECTED]> added the comment:
Also, according to wikipedia, tcl also uses that encoding.
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
paul rubin <[EMAIL PROTECTED]> added the comment:
I'm not sure what you mean by "ditto for Lucene indexes". I wasn't
planning to use C code. I was hoping to write Python code to parse
those indexes, then found they use this weird encoding, and Python's
codec set
New submission from paul rubin:
I don't see any way in the docs to get the status of an http request, in
particular I want to know whether it's a 404. It does show up in the
guts of the library so maybe I can extract it somehow, but there should
be a simple documented way.
Also, the
paul rubin added the comment:
I like the idea of having some integer math functions like this in the
stdlib; whether in the math module or elsewhere doesn't matter much. In
particular I remember having to implement xgcd on several separate
occasions for unrelated applications, each
paul rubin added the comment:
I would prefer that %d signal an error 100% of the time if you give it a
float. It should not accept 42.0. It is for printing integers.
--
nosy: +phr
_
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/iss
paul rubin <[EMAIL PROTECTED]> added the comment:
Rather than factorial how about a product function, so factorial(n) =
product(xrange(1,n+1)). I do like the idea of an imath module whether
or not it has factorial, and the topic of this rfe has drifted somewhat
towards the desirability o
New submission from paul rubin <[EMAIL PROTECTED]>:
This is observed in Python 2.5.1, I haven't tried any later versions.
d = collections.deque(xrange(10))
random.shuffle(d)
is quite slow. Increasing the size to 200k, 300k, etc. shows that the
runtime increases quadratical
paul rubin <[EMAIL PROTECTED]> added the comment:
If it's not a bug, it is at least a surprising gotcha that should be
documented in the manual. The collections module is described in the
library docs as "high performance container datatypes" but I could not
possibly
New submission from paul rubin :
Inspired by a question on comp.lang.python about how to deal with an int set
composed of integers and ranges. Range objects like range(1,5,2) contain
start, stop, and step values, but it's messy and potentially tricky to get the
actual first and last v
paul rubin added the comment:
Oh nice, I didn't realize you could do that. len(range) and bool(range) (to
test for empty) also work. Ok I guess this enhancement is not needed. I will
close ticket, hope that is procedurally correct, otherwise feel free to fix.
T
New submission from paul rubin :
It would be nice if the library reference manual had type signatures for all
the stdlib functions at some point. It might be possible to extract a lot of
them automatically from typeshed and semi-automatically paste them into the doc
files. It might also be
paul rubin added the comment:
Yes, the suggestion was just for the docs, and since those are intended for
human rather than machine consumption, it's fine if there are some blurry cases
where there is no signature. Ideally in those cases, the issue should be
explained in the doc tex
paul rubin added the comment:
abs takes any value that understands the __abs__ method and returns something
of the same type. In fact there is already a type protocol for it:
https://mypy.readthedocs.io/en/stable/protocols.html#supportsabs-t
So abs's signature would be (x : Abs[T])
paul rubin added the comment:
At first glance, having a typeclass for each protocol (at least the widely used
ones) seems fine. It's inherent in Haskell and a lot of libraries are
organized around a common set of typeclasses--look up "Typeclassopedia" for
descriptions of t
paul rubin added the comment:
I don't think we're going to accomplish anything continuing the eternal
static-vs-dynamic debate, which in Python's case has already been resolved by
adding optional static typing. It's a done deal, and the issue here is just
how to docum
paul rubin added the comment:
Oh wow, before_and_after will go into the itertools module per that patch? I
found this issue while looking for a way to this, but had written the following
implementation:
def span(pred, xs):
# split xs into two iterators a,b where a() is the prefix of xs
paul rubin added the comment:
Bah, the above doesn't work in the cases where the iterator is empty or
(different symptom) where the tail part is empty. Rather than posting a
corrected version (unless someone wants it) I'll just say not to use that code
fragment, but that the in
paul rubin added the comment:
I just saw this. Interesting. Sometimes I use ast.literal_eval to read big,
deeply nested data objects. I can probably convert to JSON if necessary but
it's another thing to watch out for. I might try to benchmark some of these.
--
nosy:
New submission from paul rubin :
It would be nice to have frozen Counters analogous to frozensets, so they are
usable as dictionary keys. One can of course create frozenset(counter.items())
but that means the set items are tuples rather than the original set elements,
so it's no l
Change by paul rubin :
--
nosy: -phr
___
Python tracker
<https://bugs.python.org/issue40334>
___
___
Python-bugs-list mailing list
Unsubscribe:
paul rubin added the comment:
Note, nowadays this is implement as itertools.chain.from_iterable .
--
___
Python tracker
<https://bugs.python.org/issue1726
paul rubin added the comment:
Yes, the idea was for them to be hashable, to be used as dict keys. E.g. if
you use frozensets to model graphs, you'd use frozen multisets for hypergraphs.
My immediate use case involved word puzzles, e.g. treating words as bags of
scrabble tiles with le
paul rubin added the comment:
Kyle, thanks, I saw your comment after posting my own, and I looked at
Raymond's mailing list post that you linked. I do think that "completing the
grid" is a good thing in the cases where it's obvious how to do it (if there's
one
paul rubin added the comment:
Oops I meant "*without* 100s of third party modules" in the case of ruby gems
or npm. There are just a few pip modules that I really use all the time, most
notably bs4. I continue to use urllib/urllib2 instead of requests because I'm
used to t
paul rubin added the comment:
Yeah I think the basic answer to this ticket is "Python doesn't really have
multisets and a proposal to add them should go somewhere else". Fair enough--
consider the request withdrawn from here.
Regarding minimalism vs completeness, regarding
paul rubin added the comment:
Totally tangential: Veky, your ordinal example would work ok in Haskell and
you'd have omega work the same way as epsilon0. Take a look at Herman Ruge
Jervell's book "Proof Theory" for a really nice tree-based ordinal notation
that g
paul rubin added the comment:
I'm the one always asking for more stuff in the stdlib, but above some
simplistic approaches this seems out of scope. Doing it usefully above say
2**32 requires fancy algorithms. Better to use some external package that
implements that stuff.
--
paul rubin added the comment:
https://bugs.python.org/issue457066 The old is new again ;-).
--
nosy: +phr
___
Python tracker
<https://bugs.python.org/issue36
New submission from paul rubin :
This is a well-explored issue in other contexts:
https://en.wikipedia.org/wiki/JSON_streaming
There is also a patch for it in json.tool, for release in 3.9:
https://bugs.python.org/issue31553
Basically it's often convenient to have a file containing a
Change by paul rubin :
Added file: https://bugs.python.org/file49154/jsonstream.py
___
Python tracker
<https://bugs.python.org/issue40623>
___
___
Python-bugs-list mailin
paul rubin added the comment:
Note: the function in my attached file wants no separation at all between the
json docs (rather than a newline between them), but that was ok for the
application I wrote it for some time back. I forgot about that when first
writing this rfe so thought I better
paul rubin added the comment:
It's coming back to me, I think I used the no-separator format because I made
the multi-document input files by using json.dump after opening the file in
append mode. That seems pretty natural. I figured the wikipedia article and
the json.tool patch
paul rubin added the comment:
Also I didn't know about ndjson (I just looked at it, ndjson.org) but its
existence and formalization is even more evidence that this is useful. I'll
check what the two different python modules linked from that site do that's
different from
paul rubin added the comment:
I don't think the interface needs much bikeshedding, as long as the implementer
chooses something reasonable. E.g. factor(30) gives the list [2,3,5].
Implementation is harder if you want to handle numbers of non-trivial size.
Neal Koblitz's book &q
paul rubin added the comment:
Note: PEP 603 may essentially take care of this, if it is accepted.
--
___
Python tracker
<https://bugs.python.org/issue40
New submission from paul rubin :
The IDLE documentation is in https://docs.python.org/3/library/idle.html which
is not where I'd have thought to look for it, since I think of IDLE as an
application rather than a library. So I looked for it on the main docs page,
docs.python.org, and d
New submission from paul rubin :
This is in the standard python 3.7.3 install under Debian 10. It's possible
that this is on purpose, and it's (separately) possible that the Debian
packagers did this for some reason. I'm not sure it's a bug but am reporting
it as it
Change by paul rubin :
--
title: mention IDLE in main python ocs page -> mention IDLE in main python docs
page
___
Python tracker
<https://bugs.python.org/issu
paul rubin added the comment:
I think I used duckduckgo to find the docs. They don't change much between
versions and I was trying to find how to do a specific thing. My installation
has the docs included but it didn't explain how to do what I wanted, so I had
hoped there
paul rubin added the comment:
Matthias, I get the same result you do when I run python from the shell command
line. I see /usr/bin in the path when I import sys and print sys.path from
inside IDLE. In other words this is an IDLE configuration oddity. Again I
don't know if it
paul rubin added the comment:
I'm using Debian 10 MATE live install and have been running IDLE by clicking an
icon on the top panel, but I just tried running IDLE from the shell prompt in a
terminal window, and also see /usr/bin in the path. In both cases, the output
of os.system
paul rubin added the comment:
Yes as mentioned I'm running Debian GNU/Linux, not Windows. By "idle is
installed in /usr/bin" I mean that it is an executable shell script stored at
/usr/bin/idle . Yes, shell prompt is the $ prompt to bash. When I run
"python3 -m idl
New submission from paul rubin :
Lots of times I want to find the largest element of a list or sequence,
defaulting to 0 if the list or sequence is empty. max(seq) throws an
exception if seq is empty, so I end up using reduce(max, seq, 0). That
is a standard functional programming idiom but
Changes by paul rubin :
--
type: -> feature request
___
Python tracker
<http://bugs.python.org/issue7153>
___
___
Python-bugs-list mailing list
Unsubscri
paul rubin added the comment:
David, I'm not on that mailing list so hadn't seen the earlier
discussion. I sympathasize with Raymond's YAGNI argument because I'm
comfortable with reduce(max,seq,0); but then I remember there was once a
movement to remove the "reduc
paul rubin added the comment:
1. Yes, the idea is to figure out the best solution and go with it (or
decide to do nothing). That many possibilities exist just points to the
need for experience and wisdom in identifying the best choice ("one and
preferably only one"). One of the
paul rubin added the comment:
ajaksu2, I don't understand why you want to close this bug if it isn't
fixed. I can accept that it's not the highest priority issue in the
world, but it's something that trips up users from time to time, and it
ix obviously fixable. Closi
paul rubin added the comment:
Daniel, thanks--I didn't mean to jump on you, so I'm sorry if it came
across that way. Maybe I'm a little oversensitized to this issue due to
some unrelated incidents with other programs.
I'll try to write a more detailed reply and maybe incl
New submission from paul rubin :
The zlib module doesn't support raw deflate format, so it doesn't
completely interoperate with php's "gzdeflate" function and fails to
decompress some strings that web browsers can decompress.
A workaround is to use a special zlib featu
Changes by paul rubin :
--
components: +Library (Lib)
type: -> feature request
versions: +Python 2.5
___
Python tracker
<http://bugs.python.org/iss
paul rubin added the comment:
I should have mentioned, the docs do say "When wbits is negative, the
standard gzip header is suppressed; this is an undocumented feature of
the zlib library, used for compatibility with unzipâs compression file
format" but this wasn't enough at the
paul rubin added the comment:
Hey, thanks for updating this. I still remember the nasty incident that got me
filing this report in the first place. I'll look at the patch more closely
when I get a chance, but the immediate comment I'd make is it's worth adding a
sentence sa
Marc Paul Rubin added the comment:
Greetings from an idle-dev 'lurker.' Has anyone tested the new dark
theme with a Set Breakpoint command? The dark theme is great for me
except for this quirk: breakpoints are invisible on my test box. Under
the Classic light scheme breakpoints a
55 matches
Mail list logo