Charles,
by your own admission, you deleted your pkl file,
And your code doesn't write that pkl file (pickle.dumps(...) doesn't
write a file it creates a new string and at no point will it write to
the file :
What you need is this :
import pickle
number=2
my_pickled_
Have you tried using Nuitka - rather than pyInstalller - it means you
distribute a single executable and the Python run time library (which
they probably have already), and it has the advantage that it is a bit
quicker than standard python.
Rather than bundle the source code and interpreter in
I am writing a C extension module for an AVL tree, and I am trying to
ensure reference counting is done correctly. I was having a problem with
the reference counting so I worked up this little POC of the problem,
and I hope someone can explain this.
Extension function :
static PyObject *_N
On 19/01/2022 11:09, Chris Angelico wrote:
On Wed, Jan 19, 2022 at 10:00 PM Tony Flury via Python-list
wrote:
Extension function :
static PyObject *_Node_test_ref_count(PyObject *self)
{
printf("\nIncrementing ref count for self - just for the hell
of
On 20/01/2022 23:12, Chris Angelico wrote:
On Fri, 21 Jan 2022 at 10:10, Greg Ewing wrote:
On 20/01/22 12:09 am, Chris Angelico wrote:
At this point, the refcount has indeed been increased.
return self;
}
And then you say "my return value is this object".
So you're incre
On 25/01/2022 22:28, Barry wrote:
On 25 Jan 2022, at 14:50, Tony Flury via Python-list
wrote:
On 20/01/2022 23:12, Chris Angelico wrote:
On Fri, 21 Jan 2022 at 10:10, Greg Ewing wrote:
On 20/01/22 12:09 am, Chris Angelico wrote:
At this point, the refcount has indeed been increased
On 26/01/2022 01:29, MRAB wrote:
On 2022-01-25 23:50, Tony Flury via Python-list wrote:
On 25/01/2022 22:28, Barry wrote:
On 25 Jan 2022, at 14:50, Tony Flury via
Python-list wrote:
On 20/01/2022 23:12, Chris Angelico wrote:
On Fri, 21 Jan 2022 at 10:10, Greg
Ewing wrote:
On 20/01
On 26/01/2022 08:20, Chris Angelico wrote:
On Wed, 26 Jan 2022 at 19:04, Tony Flury via Python-list
wrote:
So according to that I should increment twice if and only if the calling
code is using the result - which you can't tell in the C code - which is
very odd behaviour.
No, the r
On 26/01/2022 22:41, Barry wrote:
Run python and your code under a debugger and check the ref count of
the object as you step through the code.
Don’t just step through your code but also step through the C python code.
That will allow you to see how this works at a low level.
Setting a watc
On 03/01/2022 12:45, Joao Marques wrote:
Good morning: I have a very simple question: I want to start writing
programs in Python so I went to the Microsoft Store and installed
Python3.9. No problem so far. I would prefer to have a gui interface, an
interface that I can use file-->Open and File-
On 20/12/2019 18:59, Peter Otten wrote:
Chris Angelico wrote:
On Sat, Dec 21, 2019 at 5:03 AM Peter Otten <__pete...@web.de> wrote:
PS: If you are sorting files by size and checksum as part of a
deduplication effort consider using dict-s instead:
Yeah, I'd agree if that's the purpose. But l
On 10/04/2020 21:44, Elliott Dehnbostel wrote:
*We could do this:*
chars = "abcaaabkjzhbjacvb"
seek = {'a','b','c'}
count = sum([1 for a in chars if a in seek])
However, this changes important semantics by creating an entire new
list before summing.
Creating the list is pointless in this ca
On 28/04/2020 06:49, jf...@ms4.hinet.net wrote:
bvdp於 2020年4月28日星期二 UTC+8上午9時46分35秒寫道:
Oh my, that is very cool! So, I can do this:
def foo(i):
if not 'bar' in foo.__dict__:
foo.bar = 5
foo.bar += i
You can have function attribute created this way if you like:
def foo
On 24/04/2020 19:40, Manfred Lotz wrote:
I have a command like application which checks a directory tree for
certain things. If there are errors then messages will be written to
stdout.
How to test this in the best way?
One idea was for the error situations to write messages to files and
then
On 18/04/2020 15:29, Grant Edwards wrote:
On 2020-04-18, Souvik Dutta wrote:
I literally tried it!!! And it did not stop because I did not get any 1.0
rather I got 0.999 But why does this happen. This is a simple math
which according to normal human logic should give perfect numbers w
Maybe you should raise a bug (bugs.python.org) and flag that this
function is missing.
It could be that it can be introduced by whoever is maintaining the
existing code.
On 20/05/2020 08:31, Alan Gauld via Python-list wrote:
On 19/05/2020 20:53, Alan Gauld via Python-list wrote:
One of the
On 08/08/2020 18:18, Marco Sulla wrote:
Thank you, some features are interesting, even if I prefer the Python syntax.
What about the compiler? Is it better to "compile" to C or to
bytecode? How can I generate a bytecode that can be compiled by gcc?
Can I skip the AST generation for now, o
I am trying to write a simple expression to build a raw string that ends
in a single backslash. My understanding is that a raw string should
ignore attempts at escaping characters but I get this :
>>> a = r'end\'
File "", line 1
a = r'end\'
^
SyntaxError:
On 07/10/2020 12:06, Loris Bennett wrote:
Hi,
I have written a program, which I can run on the command-line thus
mypyprog --version
and the get the version, which is currently derived from a variable in
the main module file.
However, I also have the version in an __init__.py file and in
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
developer could choose which keywords would be generat
20 matches
Mail list logo