On 11Aug2010 10:32, Tim Harig wrote:
| On 2010-08-11, Wolfgang Rohdewald wrote:
| > On Mittwoch 11 August 2010, Cameron Simpson wrote:
| >> Usually you either
| >> need an option on the upstream program to tell it to line
| >> buffer explicitly
| >
| > once cat had
ine buffering then the whole situation is racey
and unreliable.
You can see that on reflection this isn't easy to resolve cleanly from
_outside_ the writing program.
To do it from inside requires all programs to sprout an option like
GNU cat's -u option.
Cheers,
--
Cameron Simpson D
On 12Aug2010 01:28, Nobody wrote:
| On Wed, 11 Aug 2010 13:08:59 +1000, Cameron Simpson wrote:
| > The reason .bashrc gets overused for envars, aside from ignorance and
| > propagated bad habits, is that in a GUI desktop the setup sequence is
| > often a bit backwards. A conventional
returned to you? The len() built in
function suggests itself...
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
--
http://mail.python.org/mailman/listinfo/python-list
er they like in python because
they won't be presented with the inner parts of the privileged stuff.
This is all rather vague because I don't know exactly what your
untrusted users need to be able to do, nor how.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
C
ing.
Otherwise, because a string _is_ a sequence the "%" might want to treat
the string "foo" as the sequence:
("f", "o", "o")
Run these three loops to see the difference:
for s in "foo":
print s
for s in ("foo"):
On 18Aug2010 12:07, Nik Gr wrote:
| Στις 18/8/2010 7:31 πμ, ο/η Cameron Simpson έγραψε:
| >On 17Aug2010 20:15, Νίκος wrote:
| >| ===
| >| cursor.execute( ''' SELECT host, hits, date FROM visitors WHERE page =
| >| '%s
ython "%" format operator at all.
This is the database API's .execute() method.
If it expects its second argument to be a sequence of parameters
(which is does) then you need to supply a sequence of parameters.
It is that simple!
In you usage above you're supplying "page
and is largely symlinks
to preferred versions of apps, apps installed out of the main paths,
and host-specific wrapper scripts.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Soon, Grasshopper, all will understand. And dispair. The government that
defines what is good for
Hey all, hopefully a simple question.
I'm writing a simple python tool that opens a file, and does something like
for line in file.readlines():
temp.write(line.doStuff())
However, I want to provide the option do this "in place", as in have the
destination file be the same as the source file.
c...@sequans.com> wrote:
> Cameron Pulsford wrote:
>
>> Hey all, hopefully a simple question.
>>
>> I'm writing a simple python tool that opens a file, and does something
>> like
>>
>> for line in file.readlines():
>>temp.write(line.doStuf
Sorry to flood the list but my google fu isn't up to par today I guess.
Basically, is it possible to read the permissions on one file and then set
the permissions of another file to the ones we just read? os.dup2 seemed
like it would work but I might not be using it correctly.
I know there is os.c
Hey all, I have a dictionary that looks like this (small example version)
{(1, 2): 0} named a
so I can do a[1,2] which returns 0. What I also have is a list of
coordinates into a 2 dimensional array that might look like this b =
[[1,2]]. Is there anyway I can call a[b[0]] and have it return 0?
--
Thanks!
On Tue, Jun 23, 2009 at 11:29 AM, Jaime Fernandez del Rio <
jaime.f...@gmail.com> wrote:
> On Tue, Jun 23, 2009 at 4:45 PM, Cameron
> Pulsford wrote:
> > Hey all, I have a dictionary that looks like this (small example version)
> > {(1, 2): 0} named a
> >
://bugs.python.org/issue1424152
There's a patch under review.
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
--
http://mail.python.org/mailman/listinfo/python-list
Hello all, I'm redoing a sudoku solver of mine and I ran into an issue with
lists of dicts. Bear with me for a second before I get to the actual
problem... I'm representing the board as a dictionary, where the keys are
(x, y) positions, and the values are candidates. So my program goes along
pickin
Hey everyone, I have this small piece of code that simply finds the
factors of a number.
import sys
def factor(n):
primes = (6*i+j for i in xrange(1, n) for j in [1, 5] if (i+j)%5 !
= 0)
factors = []
for i in [2, 3, 5]:
while n % i == 0:
n /= i
f
ng up!
On Jul 12, 2009, at 8:15 PM, Terry Reedy wrote:
Cameron Pulsford wrote:
When you start a new thread, you should start a new thread and not
piggyback on an existing thread.
--
http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list
I was initially looking at it there are some interesting patterns
I might be able to extend into a generator that would yield only
correct sets of numbers for the 6x + n pattern.
On Jul 12, 2009, at 10:26 PM, John Machin wrote:
On Jul 13, 11:24 am, Cameron Pulsford
wrote:
As far as the p
In article ,
Rami Chowdhury wrote:
>
>> Most indian languages have a different
>> grammer (compared to English). So i'm curious to see how that would be
>> implemented in a parser
>
>+1 -- I'd be interested in seeing this too, although we have drifted
>OT here and perhaps this conversation woul
This:
( user )
is not a tuple containing the element user. It's just user.
This:
( user, )
is what you want.
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
[Alain] had been looking at his dashboard, and had not seen me, so I
ran into him. - Jean Alesi on his qualifyin
from email.utils import parseaddr, getaddresses, formataddr
See the pydoc for email.utils; it's very easy to use.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Reason #173 to fear technology:
o o o o o o
^|\ ^|^
In article ,
Gabriel Genellina wrote (but I edited):
.
.
.
>More ways to define an empty function that you ever imagined:
>http://groups.google.com/group/comp.lang.python/t/c9f494b6745c7d74/
ver stored anywhere (bound to a name, for example) then it
| could be created once. When the expression is evaluated there could be
| a check so see whether 'set' is bound to the built-in class, and, if it
| is, then just use the pre-created set.
Wouldn't you need to repeat that ch
On 31Aug2010 23:38, MRAB wrote:
| On 31/08/2010 23:11, Cameron Simpson wrote:
| >On 31Aug2010 22:53, MRAB wrote:
| >| There's still the possibility of some optimisation. If the resulting
| >| set is never stored anywhere (bound to a name, for example) then it
| >| could be creat
d, and I skipped most of the
| > message because of that.
|
| You might want to switch to a client where you do not have this problem.
It was fine for me too, using mutt (fixed width text interface, 80
column terminal).
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
A monkey
a lot better off not considering it as a
storage value or as a value to print, unless you actually need to work
in the domains where it is used.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Tiggers don't like honey. - A.A.Milne, The House at Pooh Corner
--
http://mail.python.org/mailman/listinfo/python-list
), removing the
possibility of mismanagement of the output if print() is not thread safe.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Rules of Optimization:
Rule 1: Don't do it.
Rule 2 (for experts only): Don't do it yet.
- M.A. Jackson
--
http://mail.python.org/mailman/listinfo/python-list
On 16Sep2010 22:14, Ned Deily wrote:
| In article <20100917043826.ga21...@cskk.homeip.net>,
| Cameron Simpson wrote:
|
| > On 16Sep2010 09:55, mark.pellet...@asrcms.com
| > wrote:
| > | For some reason, the tasks I put into my thread pool occasionally get
| > |
uld also fail in this instance -- how is
| this worked-around?
I'd be inclined to go for ('foo', 'bar'), though that makes all the
single occurence nodes into sequences too, a bit cumbersome:-(
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
alt.s
ll has GNU ps).
Also look in /proc - the info may be available there - I expect that's
where a Linux ps gets a lot of info.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
I do not like this word 'bomb'. It is not a bomb. It is a device which
is explodi
generator
iterate
opening foo
closing foo
done
You can see there that the generator _body_ doesn't even run until you
start the iteration.
Does this clarify things for you?
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
Winter is gods' way of telling us to polish.
- Peter Harper
--
http://mail.python.org/mailman/listinfo/python-list
out an explicit wrapper to
| request it: [... damaging counter example ...]
+1 to this. Speaking for myself, I would _not_ want a generator to
commence execution unless I overtly iterate over it.
I suppose we can cue the "hasattr() runs getattr(), ouch!" discussion
here:-)
Cheers,
--
s the decorated generator.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
What I want is Facts. Teach these boys and girls nothing but Facts. Facts
alone are wanted in life. Plant nothing else, and root out everything else.
- Charles DickensJohn Huffam 18
heers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
A crash reduces
your expensive computer
to a simple stone.
- Haiku Error Messages
http://www.salonmagazine.com/21st/chal/1998/02/10chal2.html
--
http://mail.python.org/mailman/listinfo/python-list
af nodes.
The point is that you're calling leaves() on the subnode and yiled them
directly to the outside. The caller may not even know there are "subnodes".
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
The Borg assimilated my race and all I got was this
| describe is `os.walk`.
Indeed. I'm surprised it didn't occur to me.
Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
The only thing necessary for the triumph of evil is for good men to do nothing.
- Edmund Burke (1729-1797)
--
http://mail.python.org/mailma
| of following this and other lists.
I use mutt to read my python folder.
I use getmail to collect email via POP and deliver via procmail, which files
this list (and python-ideas etc) into a "python" folder, out of my main
inbox.
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting
d it leads to "drier" documentation. It also works well for Java
because it is strongly typed - a great deal of the structure in the docs
can come directly from the code because argument counts, names and types
are always explicit (or deducable).
These are just initial responses.
ot like javadoc. But its weakness is stuff like this:
http://epydoc.sourceforge.net/stdlib/Canvas.Polygon-class.html
Automatic docness, no useful information.
And of course the ugliness; I find the python docs much nicer to look
at. But I do wish the cross referencing was a bit better, often.
--
t.
P.S. Tried also some code with invoking the bash and afterwords the which
pandoc code. To know avail also
From a shell prompt (such as bash's prompt) issuing the command:
which pandoc
should print the executable path, _if_ your $PATH includes the right directory.
You can look at $PATH from the shell with the command:
echo $PATH
Do you know where pandoc normally resides on your system?
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
e(fullpath):
return fullpath, True
return "", False
Cleaner is to return the path if found, or None if not.
target, found = which("pandoc")
if found:
target will contain the full path to pandoc
else:
pandoc was not found
You want to check for execute
On 10Feb2017 00:03, eryk sun wrote:
On Thu, Feb 9, 2017 at 10:50 PM, Cameron Simpson wrote:
This is why I suggested the check_returncode() method, which examines the
error code.
You must be thinking of the returncode attribute, which isn't a
method. check_returncode() is a method o
y other interesting values that occur to you. This is really simple, and
doesn't require a terminal or using the logging module.
You can 'tail -f /path/to/your/logfile.txt' in another terminal to watch stuff
happen as you exercise the program.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
tor that uses that cache.
Like:
def fun_cache(cache):
def fun_cache_decorator(function):
def wrapper(*args):
... save things in cache instead of memo ...
return wrapper
return fun_cache_decorator
Cheers,
Cameron Simpson
--
https://mail.pytho
example, have a gander at this:
https://pypi.python.org/pypi/cs.app.megacli/20160310
which I wrote for IBM MegaRAIDs; it also does Dell PowerEdge (PERC)
controllers.
It is deliberately Python 2 BTW, because it had to run on RHEL 5 which had
Python 2.4 as the vendor supplied python.
Cheers
t, and doubly
annoying to copy from that question into the list for replies.
Thank you,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
to the email mailing list. If the
OP had merely BCCed the mailing list, I wouldn't have received a copy in my
personal inbox.
Fair point. Though I thought I only got one copy, might be wrong.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
; ):
BTW, you need to decide whther you're working in strings or integers. input()
in Python 3 returns a string. If you want to test against strings, fine.
However, if you want to test against numbers you need to convert the string to
a number:
answer8n = int(answer8)
and then test against answer8n.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
ave such a thing and of course the python.org install is standalone.
PyPI seems not forthcoming either.
What should I be doing about this?
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
7;
or even simpler:
( . /path/to/the/venv/bin/activate; exec $SHELL )
That would get you a prompt using the virtualenv by default. To reset to the
old settings, exit that subshell.
Maybe I misunderstand your needs.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
dered. Insert and pop preserve that
criterion.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
ir
else
echo "lockdir already takens, aborting" >&2
exit 1
fi
which means you don't need to fit the lock logic inside every tool, you can
just do it in the script that calls them.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
ir content (not actually unheard of)?
> - some other solution I've missed?
What about some variation on:
from tempfile import NamedTemporaryFile
...
with NamedTemporaryFile(dir=your_target_directory) as T:
use T.name, and do your rename/unlink in here
Cheers,
Cameron Simpson
that. But
Gregory Ewing's suggestion is much more direct.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
around "who is logged in". Because the latter is not equivalent
to "whose information should I access?"
I hope this points a way forward.
Personally I would usually resist accessing information not available as the
user, and avoid the need to run as root at all.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
On 04May2017 20:42, Wildman wrote:
On Fri, 05 May 2017 09:00:58 +1000, Cameron Simpson wrote:
On 04May2017 15:03, Wildman wrote:
The program installs using the Debian package system (.deb) and an
entry is created in the Applications Menu. The strange thing is
that the crash only occurs when
ity decisions, particularly with things that automatically run
as root. In particular, don't just think about how to get the behaviour you
want; think about how to _break_ it - get root as the wrong person, or get root
to give you information you should not have. Etc.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
locate C1, and returns the left and right sublists.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
r
filenames and the order they came back from the glob
Try making these files in your test directory:
foo
foo_chunk_0
foo_chunk_1
foo_chunk_2
foo_chunk_10
and see what happens to your code. Temporarily drop the "with open..." and just
print the filenames to see what order you would have processed the files.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
On 25May2017 20:37, Mahmood Naderan wrote:
Cameron, thanks for the points. In fact the file name contains multiple '_'
characters. So, I appreciate what you recommended.
filenames = {}
for name in glob.glob('*chunk_*'):
left, right = name.rsplit('_', 1)
hat would be a return value as the final item. Not very
happy with it though.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
script, I'm leaning towards hacking the
activate script, probably by keeping a distinct file off the the side and
modifying activate to source it.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
s like it was made using virtualenv-3.5) and it has no
hooks in the shell code, so Tim's stuff looks like it comes from
virtualenvwrapper.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
if isinstance(obj, type)
else isinstance(obj, BaseException)
)
?
Curious: why do you need to test this? Some function which may return a "value"
or an exception?
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
ear that
he did indeed want to remove a single item from the things named in $PATH. He
even provided example code showing exactly what he wanted to remove, and which
demonstrated that he knew it was a colon separated string, which he was
presenting as lines for purposes of clarity.
Cheers,
Cam
arly" kind of guy, and to me Steve's approach is in the same
spirit as raising ValueError when a function is handed invalid arguments.
Particularly if the mistake is easy to make, having one's attention brought to
it immediately (at "declaration" time, since Steve'
n iteration situations, with the for
loop being the classic example.
As a bonus, later you can use this paradigm when talking about generators and
classes that implement "large but only computed on demand" things.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
) would go:
def write(self, tickId: int):
self.con.execute(blah)
and as you can see that _removes_ any need to pass the connection back to the
caller - you don't need to expose an reqConnection method at all, or manage it
in the caller. Instead, ClassA can just store the DB instance itself, and let
DB look after all the specifics. That is exactly the kind of thing class
encapsulation is meant to achieve: the caller (Class A) can wash its hands of
the mechanisms, which are not its problem.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
go of the match object "m" or of the line (which is probably
attached to the match object "m" to support things like m.group() and so
forth).
So you might need to show us the handling code.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
on
# but maybe no such lines is just normal but boring
raise ValueError("no CRC lines seen in logfile %r" % (logfile,))
# found no changes
return False
See that there is very little sanity checking. In an exception supporting
language like Python you can often
er
in order to speed up namedtuple and reduce Python's startup time.
Is there anyone here who uses the namedtuple _source attribute?
Speaking for myself: no I do not.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
RE
against a fixed empty string it is hard to be exploited. i.e. I think most of
this stuff isn't expensive in terms of compiling the regexp but in executing it
against text.
Happy to hear to falsifications to my beliefs here.
Cheers,
Cameron Simpson (formerly c...@zip.com.au)
--
https://mail.python.org/mailman/listinfo/python-list
On 09Aug2017 10:46, Jon Ribbens wrote:
On 2017-08-09, Cameron Simpson wrote:
On 08Aug2017 17:31, Jon Ribbens wrote:
... but bear in mind, there have been ways of doing denial-of-service
attacks with valid-but-nasty regexps in the past, and I wouldn't want
to rely on there not being an
Versus:
o = o2
which changes which object the name "o" refers to ("is bound to"): it now
refers to the second object we made.
This is exactly analogous to the array example, but using objects. The notation
eg "alist[1]" or "o.x" is just what you need to say to designate which
reference you are changing.
Cheers,
Cameron Simpson (formerly c...@zip.com.au)
--
https://mail.python.org/mailman/listinfo/python-list
3] list, then modifies an
unrelate new list. So "ss" is unchanged, still holding [1,2,3].
Then test modifies the original list (affecting what "ss" holds) and then
points its local "alist" at something else (another shiny new list). But that
doesn't change what "ss" refers to, so it now has [3,6,9].
Cheers,
Cameron Simpson (formerly c...@zip.com.au)
--
https://mail.python.org/mailman/listinfo/python-list
k. This can lead to errors when a name is used
within a block before it is bound. This rule is subtle. Python lacks
declarations and allows name binding operations to occur anywhere within a code
block. The local variables of a code block can be determined by scanning the
entire text of the block for name binding operations."
Cheers,
Cameron Simpson (formerly c...@zip.com.au)
--
https://mail.python.org/mailman/listinfo/python-list
I bet this is asked quite frequently, however after quite a few hours searching
I haven't found an answer.
What is the thinking behind stopping 'one short' when slicing or iterating
through lists?
By example;
>>> a=[0,1,2,3,4,5,6]
>>> a
[0, 1, 2, 3, 4, 5, 6]
>>> a[2:5]
[2, 3, 4]
To my mind,
Thanks everyone for taking the time to offer some very insightful replies.
Learning a new language is so much more fun with a group of friendly and
helpful people around!
--
http://mail.python.org/mailman/listinfo/python-list
ould be done as root, and in this case that is
easily avoided, with all its potential for damage to the vendor supplied
environment.
Cheers,
Cameron Simpson (formerly c...@zip.com.au)
--
https://mail.python.org/mailman/listinfo/python-list
l code (C++, Go, what have you).
You can ship C code with Python to be compiled on the target and presented to
Python as a library, and by convention such modules are named with a leading
underscore. So we can expect that _imaging is a C code module.
And if you go up a level you'll find _imaging.c, with a draw_ellipse function
inside it.
Cheers,
Cameron Simpson (formerly c...@zip.com.au)
--
https://mail.python.org/mailman/listinfo/python-list
On 26Nov2017 10:00, nospam.Martin SchĶĶn wrote:
>Den 2017-11-26 skrev Cameron Simpson :
>> On 25Nov2017 08:34, rusi wrote:
>>>On Saturday, November 25, 2017 at 9:45:07 PM UTC+5:30, Michael Torrie wrote:
>>>> The problem with mixing repository-installed packages wi
Hello! I invite you to participate in the Python Packages Survey - it takes
less than a minute to complete, and will help open source developers
understand their users' better. Thanks for participating!
https://python-packages-survey.com/
--
Cameron Davidson-Pilon
Data Origami &
l code (C++, Go, what have you).
You can ship C code with Python to be compiled on the target and presented to
Python as a library, and by convention such modules are named with a leading
underscore. So we can expect that _imaging is a C code module.
And if you go up a level you'll find _imaging.c, with a draw_ellipse function
inside it.
Cheers,
Cameron Simpson (formerly c...@zip.com.au)
--
https://mail.python.org/mailman/listinfo/python-list
And of course I'm very -1 on None acquiring iteration or other features.
Fail early, fail often!
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
On 21Jun2023 10:09, Chris Angelico wrote:
On Wed, 21 Jun 2023 at 09:59, Cameron Simpson via Python-list
wrote:
I wasted some time the other evening on an API which returned a
string
or None. My own API, and the pain it caused tells me that that API
design choice isn't good (it's an
e)
There's similar language in this try/except documentation:
file:///Users/cameron/var/doc/python/3.8.0/reference/compound_stmts.html#index-10
For an except clause with an expression, that expression is
evaluated, and the clause matches the exception if the resulting
object
er the
underlined code?
Is this "clairvoyant" behaviour a side-effect of the new parser or was
that a deliberate decision?
I have the vague impression the new parser enabled the improved
reporting.
Used to use a Pascal compiler once which was uncannily good at
suggestin
On 07Aug2023 08:02, Barry wrote:
On 7 Aug 2023, at 05:28, Cameron Simpson via Python-list
wrote:
Used to use a Pascal compiler once which was uncannily good at
suggesting where you'd missing a semicolon.
Was that on DEC VMS? It was a goal at DEC for its compilers to do this well.
ble. But in a very long piece of code with many
imports you might go for module1.funcname for clarity, particularly if
funcname is generic or overlaps with another similar imported name.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
ll it, the "bound method" knows that t is associated
with `a` and puts that in as the first argument (usually named `self`).
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
On 19Oct2023 20:16, Bongo Ferno wrote:
A with statement makes clear that the alias is an alias and is local,
and it automatically clears the variable after the block code is used.
No it doesn't:
>>> with open('/dev/null') as f:
... print(f)
...
<_io.TextIOWrapper name='/dev/
This message:
NameError: name 'Pnt' is not defined. Did you mean: 'PNT'?
is unfortunate, because you have a very similar "PNT" name in scope. But
it isn't what you want.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
special unique and opaue URL,please visit it to confirm receipt
of this email (implying email is 'real"). You see this a lot when
signing up for things. And for plenty of things I generate a random
throw away address at mailinator.com (looking at you, every "catch up"
free o
/rfc2821#section-4.1.1.6
I think a lot of mail receivers don't honour this one, for exactly the
reasons above.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
grades.append(s.name)
grades.append(s.finalGrade())
if s.finalGrade()>82:
grades.append("Pass")
else:
grades.append("Fail")
print(grades)
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
ince I imagine config_database() would accept any kind of mapping
(dicts, etc etc).
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
On 21Jan2024 23:39, bagra...@live.com wrote:
class NameMe(dict):
def __missing__(self, key):
return key
I would need to know more about what it might be used for. What larger
problem led you to writing a `dict` subclass with this particular
`__missing__` implementation?
--
https:/
On 08Feb2024 12:21, tony.fl...@btinternet.com wrote:
I know that mappings by default support the ** operator, to unpack the
mapping into key word arguments.
Has it been considered implementing a dunder method for the **
operator so you could unpack an object into a key word argument, and
the
2301 - 2400 of 2434 matches
Mail list logo