On 2023-11-17 07:48:41 -0500, Thomas Passin via Python-list wrote:
> On 11/17/2023 6:17 AM, Peter J. Holzer via Python-list wrote:
> > Oh, and Python (just like Perl) allows you to embed whitespace and
> > comments into Regexps, which helps readability a lot if you have to
> &g
he (unspoken?) context here is "if tuples are sufficient, then ..."
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at |-- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | chal
nguishes between some primitive types (string, number,
boolean, null) and provides two container types (dict/object,
list/array). As long as those types are sufficient, JSON includes them.
If you need anything else, you're on your own.
hp
--
_ | Peter J. Holzer| Story must ma
etc.
> or just specify the right version
> on the command line. In that case you might as well not have included the
> shebang line at all.
Right. However, that's not how scripts are usually invoked on Unix.
Using /usr/bin/env in the command line is supposed to fix that but of
course it
urse write python files from a python script (in fact I
do this), but that's not what this pattern is about, AFAICS.
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at |-- Charles Stross, &quo
On 2023-12-29 09:01:24 -0800, Grant Edwards via Python-list wrote:
> On 2023-12-28, Peter J. Holzer via Python-list wrote:
> > On 2023-12-28 05:20:07 +, rbowman via Python-list wrote:
> >> On Wed, 27 Dec 2023 03:53:42 -0600, Greg Walters wrote:
> >> > The big
> class Class1:
> pass
o = Class1()
f1(o, 'The plain function')
works for me.
> class Class2:
> pass
>
> c1 = Class1()
> c1.newfunc = f1
> c1.newfunc('f1 assigned to instance') # Works as intended
Now this doesn't work any more (but the O
s
from you in the "nan" thread.
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at |-- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
signature.asc
Desc
send you a notification that the mail cannot
currently be delivered and that it will keep trying. Such notifications
are usually sent after a much shorter period (a few hours).
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...
lo = lookup.get_lookup("test1")
...
lo = lookup.get_lookup("test2")
...
lo = lookup.get_lookup("test3")
hp
PS: You don't have to put that in a separate module but I think it's a
lot cleaner that way.
--
_ | Peter J. Holzer| Story mu
#x27;t bulletproof but I've
found it very handy.
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at |-- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
s
On 2024-03-17 17:15:32 +1300, dn via Python-list wrote:
> On 17/03/24 12:06, Peter J. Holzer via Python-list wrote:
> > On 2024-03-16 08:15:19 +, Barry via Python-list wrote:
> > > > On 15 Mar 2024, at 19:51, Thomas Passin via Python-list
> > > > wrote:
>
any direct connection to the xkcd cartoon.
In my opinion the connection to Perl sigils is very direct.
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at |-- Charles Stross, "Creative writing
__/
gt;
> Nonetheless, Perl folk do use that term, specifically.
I'm pretty sure he's referring to the use of @ in python to denote a
decorator here. Which is a totally different thing than a Perl sigil.
hp
--
_ | Peter J. Holzer| Story must make more sense than rea
not being flush left?
Ramism.
> It is sort of contrary to what I think of as "normal" indentation.
Stefan is well known for doing everything contrary to normal convention.
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) |
s capabilities.
OTOH, there is something like domterm[1], which can (theoretically)
display anything a browser can display.
hp
[1] https://domterm.org/index.html
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at
width, parity, ...) and then hands over to
login. Of course in the case of a linux console there is no modem and no
serial line involved, so it doesn't have much to do. (Of course this
raises the question whether the Linux console is a terminal or a
terminal emu
ven less because many distributions come with a decent
set of Python packages.
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at |-- Charles Stross, "Creative writing
__/ | http://www.hjp.
If
we relied on the distro's package management that would basically be a
non-issue.
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at |-- Charles Stross, "Creative writing
__/ | ht
python3 -m pip install --user --break-system-packages
does indeed install into ~/.local/lib/python3.XX/site-packages.
This inconvenient, but otoh I have accidentally installed packages into
~/.local in the past, so maybe it's good to make that more explicit.
hp
--
_ | P
ypographical convention, so your texts are unlikely to make
this distinction.
hp
[1] Which I use rarely, anyway.
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at |-- Charles Stross, "Cr
example, since you have a list of tuples, not a
list of lists and a tuple is not an instance of a list.
> return '(' + ' '.join(map(lispstr, exp)) + ')'
> else:
> return str(exp)
>
> def Lprint(x): print(lispstr(x))
I like to
3 201 202 203 301 302 303 401 402 403
>
>
> I /think/ you can replace it with {1...4} and {1...3}? I know there is
> some syntax for "range of numbers" but I can't remember it exactly.
Only two dots, not three:
% echo {1..4}0{1..3}
101 102 103 201 202 203 301 302 303 401
t (unlike xfce4-terminal
which shows the emoji just fine).
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at |-- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!&qu
the context of a database app
> where I build Getters for database data and pass one Getter per
> instance.
Or in this case, since each function is specific to one instance, you
could just use a closure to capture the object. But that might be
confusing to any future maintainers (e.g. yourse
gine brings me to
https://numpy.org/doc/stable/reference/generated/numpy.gcd.html
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at |-- Charles Stross, "Creative writing
__/ | http://
re is no way
to set up a venv first and then install Python into it.
Does Devuan have a testing or unstable suite? You might be able to
install a newer Python version from that. If not your best bet is to
install Python from source.
hp
--
_ | Peter J. Holzer|
#x27;d'
(I'm not sure what "indx = 4" was supposed to do. You can't assign
inside of a condition.)
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at |-- Charles Stross, "
e in an email address is valid, but it is). Include meaningful
error messages (not just "input invalid"). Helping your legitimate users
is more important than slightly inconveniencing an attacker.
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_)
sion than
anything the re module could reasonably produce (although with the
caveat that such a web site would use a different implementation and
therefore might produce different results).
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) |
On 2024-10-12 08:51:57 -0400, Thomas Passin via Python-list wrote:
> On 10/12/2024 6:59 AM, Peter J. Holzer via Python-list wrote:
> > On 2024-10-11 17:13:07 -0400, AVI GROSS via Python-list wrote:
> > > Is there some utility function out there that can be called to sh
On 2024-10-19 00:15:23 +0200, jak via Python-list wrote:
> Peter J. Holzer ha scritto:
> > As a trivial example, the regular expressions r"\\sout{" and r"\\sout\{"
> > are equivalent (the \ before the { is redundant). Yet
> > re.compile(s).pattern preserv
in general no suitable
human readable string representation of a whole email. You have to go
through it part by part and decide what you want to do with each. For
example, if you have a multipart/alternative with a text/plain and a
text/html part what should the "string representation" be?
achine-readable information like addresses or message ids.
hp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at |-- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
t" I mean a collection of software for a common purpose.
That might be a collection of scripts, it might be web site, etc.
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at |-- Charles Stross, "Creative w
hon discussing the language and
helping each other when we can (some of us are also contributors to
Python).
> doesn't ever understand the problem.
Quite possibly, but in that case you haven't explained it well enough.
hp
--
_ | Peter J. Holzer| Story must make more sen
different directory ("HOME/ext/..." is
a relative path. That will not work in a different directory. Also
"HOME" is a strange choice for a directory name. Did you mean $HOME?) or
because the acceptance tests set up their own environment.
I'd test the first idea first. Cd int
pts which activate the venv. Python
does that all by itself.
I have a small script, install-python[1], to assist with setting the
hashbang, but if it's just a few scripts you can simply edit it manually.
hp
[1] https://git.hjp.at:3000/hjp/install-python/src/branch/master/install-pyth
appealing to me (not to mention that it might be
unacceptably slow).
hjp
--
_ | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| | | h...@hjp.at |-- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
s
On 2025-04-18 13:08:36 -0400, Thomas Passin via Python-list wrote:
> On 4/18/2025 11:38 AM, Peter J. Holzer via Python-list wrote:
> > On 2025-04-18 13:24:28 +1200, Greg Ewing via Python-list wrote:
> > > On 18/04/25 9:41 am, Mats Wichmann wrote:
> > > > There'
On 2025-04-18 17:11:33 +0100, Oscar Benjamin via Python-list wrote:
> On Fri, 18 Apr 2025 at 16:50, Peter J. Holzer via Python-list
> wrote:
> >
> > On 2025-04-18 13:24:28 +1200, Greg Ewing via Python-list wrote:
> > > On 18/04/25 9:41 am, Mats Wichmann wrote:
> &
cumentation should match the current implementation and not something
which may or may not be implemented at some point in the future.
> but seeing how many other things are done in Python, this is not an
> exception. It would've been strange to have it done properly when
> "prop
gram now before it breaks.
One could argue that it should say 'unrecognized escape sequence'
instead of 'invalid escape sequence', since it isn't invalid yet, but
that's nitpicking.
hjp
--
_ | Peter J. Holzer| Story must make more sense than
601 - 643 of 643 matches
Mail list logo