Re: why sqrt is not a built-in function?

2021-01-15 Thread Greg Ewing
port' statements get compiled into a call to __import__. It also provides a way of importing something specifed by a string at runtime, so it can be useful. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Exploring terminfo

2021-01-15 Thread Greg Ewing
On 16/01/21 3:37 pm, Chris Angelico wrote: Surely it should be the other way around? If you use the C stdio streams, flush them after use. 1. You might not know that you're (implicitly) using C stdio. 2. There doesn't seem to be an easy way to flush C stdio from Python any more

Re: Exploring terminfo

2021-01-16 Thread Greg Ewing
urpose of stdio buffering. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Exploring terminfo

2021-01-16 Thread Greg Ewing
em in this particular case stems from trying to use parts of curses without initialising it properly. I expect that initialising curses would put stdout into some kind of unbuffered mode, and the rest of it assumes that this has been done. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Exploring terminfo

2021-01-17 Thread Greg Ewing
(3x), tgoto(3x), tputs(3x) - direct curses interface to the terminfo capability database -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Exploring terminfo

2021-01-18 Thread Greg Ewing
me it would be useful to have something that returns what tputs() would have output, as a string, so you can send it where you want. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Best practice for handling exceptions raised at lower levels?

2021-02-02 Thread Greg Ewing
_user("Couldn't connect to %s: %s" % (address, e)) 2. If it's anything else, I assume it's a bug and let it propagate. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: super() in injected methods

2021-02-11 Thread Greg Ewing
ch it. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: New Python implementation

2021-02-11 Thread Greg Ewing
On 12/02/21 11:33 am, Mr Flibble wrote: neos isn't a Python package so that isn't a problem. It might be a bit confusing if it ever becomes part of the wider Python ecosystem, though. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: super() in injected methods

2021-02-11 Thread Greg Ewing
time to a subclass of Port having the required features. That would be a lot easier and more efficient than adding individual methods to every Port instance, and super() should work normally. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: weirdness with list()

2021-02-28 Thread Greg Ewing
ts __len__ should return the number of items you would get if you iterated over it. Anything else is confusing and can lead to trouble, as you found here. But is there a cleaner way to do this? Yes. Give up on using __len__ to get the length in bytes, and provide another way to do that. -- Greg

Re: Why assert is not a function?

2021-03-02 Thread Greg Ewing
On 3/03/21 12:24 pm, Chris Angelico wrote: if PRODUCTION: def assert(*a, **kw): pass would work if it were a function :) But would cost you a useless function call for every assert in production mode. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Canonical conversion of dict of dicts to list of dicts

2021-03-31 Thread Greg Ewing
table or not makes no difference. You can see this if you do the equivalent thing with lists: >>> a = ["alice", "bob", "carol"] >>> b = a >>> b ['alice', 'bob', 'carol'] >>> b = ['dave', 'edward', 'felicity'] >>> a ['alice', 'bob', 'carol'] >>> b ['dave', 'edward', 'felicity'] -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread Greg Ewing
ves deep enough, making it quite tricky to break off a row cleanly. I'd upload a patch for that, but it doesn't seem to be open source. At least I can't find it on chochub. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Friday Finking: initialising values and implied tuples

2021-04-04 Thread Greg Ewing
12 RETURN_VALUE Here the tuple creation is being done at compile time, so there's still an unpacking operation. It might not be much different speed-wise from loading the values separately, though. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Yield after the return in Python function.

2021-04-05 Thread Greg Ewing
reachable or not. It would also break existing code. An unreachable "yield" is sometimes used as a way to get a generator that doesn't yield anything. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Unsubscribe/can't login

2021-05-05 Thread Greg Ewing
me message. Reading comp.lang.python with Thunderbird. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Greg Ewing
My opinion on all this: The volume in this newsgroup is nowhere near high enough to be worth changing anything. This thread itself now contains more messages than the recent neopython trollage that prompted it. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python ...

2021-05-24 Thread Greg Ewing
t; int = 42 >>> int 42 >>> __builtins__.int >>> -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python ...

2021-05-25 Thread Greg Ewing
es? Why should they be treated differently to built-in types? Or are you suggesting there should be a special syntax for declaring type names? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python ...

2021-05-25 Thread Greg Ewing
he shadowing would be detected at compile time, so you would only be warned once. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python ...

2021-05-25 Thread Greg Ewing
On 26/05/21 3:33 am, Dennis Lee Bieber wrote: the OBJECTS have a type and can not change type. Well... built-in types can't, but... >>> class A: ... pass ... >>> class B: ... pass ... >>> a = A() >>> type(a) >>> a.__class__ = B >>

Re: imaplib: is this really so unwieldy?

2021-05-25 Thread Greg Ewing
st giving you access to a namespace. But if you prefer, you can get the same result without needing an import using raise SystemExit(1) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python ...

2021-05-25 Thread Greg Ewing
er. Almost every object in Python has an interpretation as true or false, and can be used wherever a boolean value is needed. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python ...

2021-05-26 Thread Greg Ewing
en contains the thing you found. It also has the benefit of being simple and consistent with the way scoping and assignments work in the rest of the language. There are other ways to code a search, of course, but it's been the way it is from the beginning, and changing it now would be massively

Re: Turtle module

2021-05-26 Thread Greg Ewing
On 27/05/21 4:17 am, Chris Angelico wrote: Worst case, it is technically available as the ._fullcircle member, but I would advise against using that if you can help it! If you're worried about that, you could create your own turle subclass that tracks the state how you want. -- Greg --

(OT) Re: Applying winpdb_reborn

2021-05-29 Thread Greg Ewing
electronics in sight. Even the little dot-matrix printer that wrote human-readable characters along the top of the card was all mechanical! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Definition of "property"

2021-05-31 Thread Greg Ewing
So a Python-specific definition is necessarily going to be very different from a generic one. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Definition of "property"

2021-05-31 Thread Greg Ewing
ction. That's not a definition of a property -- it's talking about a mechanism that provides one way of creating a property, using decorators. DON'T quote that as a definition! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Definition of "property"

2021-05-31 Thread Greg Ewing
at in most cases the method is implemented in C and it looks up a value in the object's dict. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Definition of "property"

2021-06-01 Thread Greg Ewing
attribute? (I'm assuming that by "data attribute" you mean a piece of data that's stored directly in the object. If you mean something else, we might be talking at cross purposes.) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Definition of "property"

2021-06-01 Thread Greg Ewing
definition. Python's definition is somewhat unusual, and so would not be appropriate. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Behaviour of pop() for dictionaries

2021-06-14 Thread Greg Ewing
#x27;s not generally useful to get an arbitrary value from a dict without its corresponding key. Hence the existence of popitem(). -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: optimization of rule-based model on discrete variables

2021-06-14 Thread Greg Ewing
and g represent? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Terminology: EU language skills, and Master to Main (or ...)

2021-06-14 Thread Greg Ewing
eir names? Worst of all, will episodes of Doctor Who featuring the Master be banned? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: optimization of rule-based model on discrete variables

2021-06-14 Thread Greg Ewing
I think I still need more information about the underlying problem before I can help you much. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Why the list creates in two different ways? Does it cause by the mutability of its elements? Where the Python document explains it?

2021-06-15 Thread Greg Ewing
2] b = [1, 2] c = [1, 2] d = [1, 2] s = (a, b) t = (c, d) then you are guaranteed to get four different list objects and two diffferent tuple objects. Does that help to ease your fears? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Why the list creates in two different ways? Does it cause by the mutability of its elements? Where the Python document explains it?

2021-06-15 Thread Greg Ewing
objects. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: optimization of rule-based model on discrete variables

2021-06-15 Thread Greg Ewing
in all of this. If the ultimate goal is to find a better mixture, you need some kind of figure of merit for an individual mixture. But you don't have that, you only have this thing g that somehow depends on all of your mixtures at once. I'm still not seeing the big picture. -- Greg -

Re: Why the list creates in two different ways? Does it cause by the mutability of its elements? Where the Python document explains it?

2021-06-15 Thread Greg Ewing
3. If you use int division instead, they all get merged: >>> NoDup = [(5, 2), (6-1, 6//3), (12%7, 1//1 + 1//1)] >>> [id(x) for x in NoDup] [4387030272, 4387030272, 4387030272] So you need to be tricker than that to fool it! The bottom line is, don't write code that depends on the identities of immutable objects. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Where did the message go?

2021-06-16 Thread Greg Ewing
on "haydn" triggered in my brain was a local company that I have professional dealings with. Only when I read a bit further did I realise it was referring to the composer! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: optimization of rule-based model on discrete variables

2021-06-16 Thread Greg Ewing
On 16/06/21 10:51 pm, Elena wrote: sorry I wrote it wrongly, my bad, I will use f just to predict yi from new coming Xi. Then what do you do with the new yi? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Optimizing Small Python Code

2021-06-22 Thread Greg Ewing
On 23/06/21 3:03 am, Kais Ayadi wrote: for n in range(1, 7): print (n) for x in range(0, n): print(" ", x) can this code be more optimised? Optimised for what? Readability? Execution speed? Code size? Memory usage? -- Greg -- https://mail.python.org/mailma

Re: How to iterate through maildir messages in python 3?

2021-06-24 Thread Greg Ewing
However, that won't work very well if the message doesn't consist of mostly text in an ASCII-compatible encoding. If you want something better, Python comes with some standard library code for dealing with mail messages. Check out the 'email' module. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: i just moved from bottleframework to flask. I changes what needed to be altered to convert the code and when i run it i just get "Internal server error" Running tail -f ../logs/error_log i get no

2021-07-10 Thread Greg Ewing
On 11/07/21 2:24 am, Dennis Lee Bieber wrote: Off-hand, that looks like a BASH command, so stuff it in your .bashrc or .profile and see what happens. Or make yourself a little shell script that starts flask with the appopriate settings. -- Greg -- https://mail.python.org/mailman

Re: Rotation of a cube

2021-07-29 Thread Greg Ewing
://medium.com/quick-code/3d-graphics-using-the-python-standard-library-99914447760c -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-07 Thread Greg Ewing
..), then I subtract 1 from 1, getting 0 (that's J, ...), so I got "kcaJ" but my counter is 0 not -13, which was my stopping point. You need to first replace any negative or missing indices with equivalent indices measured from the start of the string. When you do that in this example, y

Re: some problems for an introductory python test

2021-08-11 Thread Greg Ewing
hat may not be doing what you think it's doing. Consider also >>> if0: print('yes!') yes! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: some problems for an introductory python test

2021-08-12 Thread Greg Ewing
)) "Module(body=[AnnAssign(target=Name(id='if0', ctx=Store()), annotation=Call(func=Name(id='print', ctx=Load()), args=[Constant(value='yes!', kind=None)], keywords=[]), value=None, simple=1)], type_ignores=[])" "An annotated assignment without th

Re: some problems for an introductory python test

2021-08-12 Thread Greg Ewing
, it was often the entire contents of the file. Applications had all the code in there, for example -- the data fork of an application was usually empty. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: on perhaps unloading modules?

2021-08-16 Thread Greg Ewing
what the module itself does, but what other modules do with it. If any other module has imported it, that module will still contain references to the old module; if there are instances of a class defined in it still existing, they will still be instances of the old version of the class; etc.

Re: Regarding inability of Python Module Winsound to produce beep in decimal frequency

2021-08-18 Thread Greg Ewing
On 18/08/21 4:43 pm, Steve wrote: "The HAL (hardware abstraction layer) function HalMakeBeep()" Is the beep that opens the pod bay doors? def HalMakeBeepUsingPCSpeaker(): raise IOError("I'm sorry, I can't do that, Dave.") -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: question on trax

2021-08-18 Thread Greg Ewing
27;ll have to tell us what you do want. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: on perhaps unloading modules?

2021-08-20 Thread Greg Ewing
lobals dict: g = {} exec(code(), g) g['p']() -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: on perhaps unloading modules?

2021-08-21 Thread Greg Ewing
the course anyway!) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: on floating-point numbers

2021-09-04 Thread Greg Ewing
ause NaNs never compare equal. You still get a NaN either way, so for all practical purposes it's commutative. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: on floating-point numbers

2021-09-04 Thread Greg Ewing
minator is a power of 10, reduce that to lowest terms, and compare with the result of as_integer_ratio(). -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: on writing a while loop for rolling two dice

2021-09-07 Thread Greg Ewing
On 7/09/21 11:38 am, Avi Gross wrote: #define INDEFINITELY_LOOP while (true) So, how to do something like that in python, is a challenge left to the user 😉 def hell_frozen_over(): return False while not hell_frozen_over(): -- Greg -- https://mail.python.org/mailman/listinfo

Re: on writing a while loop for rolling two dice

2021-09-07 Thread Greg Ewing
that sort of thing if you're a Really Smart Person. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Friday Finking: Contorted loops

2021-09-10 Thread Greg Ewing
execute completely at least once, and aren't bugs waiting to be triggered by an edge case such as empty input. I seem to remember someone - maybe Wirth? - long ago expressing the opinion that repeat-until loops often tended to be error prone, but I can't provide a reference, sorry. -- Greg

Re: Change the display style of the text on the STACKLINE.

2021-09-10 Thread Greg Ewing
On 10/09/21 6:11 pm, Roland Mueller wrote: When I call print(s) it even shows ABCD and D is underscored. But copying the output to mail looses the underscore ... If the terminal understands unicode, Combining Low Line: U+0332 might help -- Greg -- https://mail.python.org/mailman/listinfo

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

2021-09-16 Thread Greg Ewing
s* something in the stdlib called an array, but it's rarely used or needed.) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

2021-09-16 Thread Greg Ewing
nd of object it is, rather than a generic name such as "obj". -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

2021-09-17 Thread Greg Ewing
look up the name, if it's global, which it usually is, and the machinery of the call itself. * Creating objects is expensive. Creating instances of user-defined objects is more expensive than built-in ones. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

2021-09-18 Thread Greg Ewing
y scan the trail looking for dead weakref objects and remove the corresponding [*] node from the list. You can also attach callbacks to weakref objects that are triggered when the referenced object dies. You might be able to make use of that to remove items from the trail instead of the per

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

2021-09-18 Thread Greg Ewing
aid to use them when it makes sense to do so. I'm not sure what you mean by "some code annotations", so I don't know how to answer that question. I suspect that the way exceptions are implemented in the JVM is similar to the way CPython does it, but I don't kno

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

2021-09-18 Thread Greg Ewing
peek: ... But if get() in Python is implemented under the hood with exception handling. ... then Python get() will probably be quite slow. No, it doesn't use exceptions as far as I know. It should be fairly fast. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

2021-09-20 Thread Greg Ewing
skip over dead ones during backtracking. Seems to me you would be doing about the same amount of work either way, just doing it at different times. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Type annotation pitfall

2021-09-24 Thread Greg Ewing
.g. class Foo(): x : set def __init__(self, s): self.x = set() if s: self.x.add(s) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Different "look and feel" of some built-in functions

2021-09-24 Thread Greg Ewing
make it possible, but that would be turning them into special cases that break the rules. It would be better to provide separate functions, as was done with sum(). -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: XML Considered Harmful

2021-09-24 Thread Greg Ewing
's bizarre. It's as though there were a large community of professional builders who insisted on using hammers to drive scews, and extolled the advantages of doing so. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: XML Considered Harmful

2021-09-24 Thread Greg Ewing
ating point and writing them out again with exponents... -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: XML Considered Harmful

2021-09-24 Thread Greg Ewing
at in a different way. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: XML Considered Harmful

2021-09-24 Thread Greg Ewing
On 25/09/21 11:00 am, Chris Angelico wrote: On Sat, Sep 25, 2021 at 8:53 AM dn via Python-list wrote: and YAML? Invented because there weren't enough markup languages, so we needed another? There were *too many* markup languages, so we invented another! -- Greg -- https://mail.pytho

Re: XML Considered Harmful

2021-09-28 Thread Greg Ewing
On 29/09/21 4:37 am, Michael F. Stemper wrote: I'm talking about something made from tons of iron and copper that is oil-filled and rotates at 1800 rpm. To avoid confusion, we should rename them "electricity comprehensions". -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: AttributeError

2021-09-28 Thread Greg Ewing
On 29/09/21 12:21 pm, Chris Angelico wrote: to the extent that you automatically read 65 and 0x41 as the same number. Am I too geeky for reading both of them as 'A'? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: AttributeError

2021-09-29 Thread Greg Ewing
more than a byte at a time. The second was a 6800, which is big-endian. That's definitely more convenient when you're hand-assembling code! I can see the advantages of little-endian when you're implementing a CPU, though. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: AttributeError

2021-09-29 Thread Greg Ewing
On 30/09/21 7:28 am, dn wrote: Oh yes! The D2 kit - I kept those books for years... https://www.electronixandmore.com/adam/temp/6800trainer/mek6800d2.html My 6800 system was nowhere near as fancy as that! It was the result of replacing the CPU in my homebrew Miniscamp. -- Greg -- https

Re: New assignmens ...

2021-10-22 Thread Greg Ewing
On 23/10/21 8:49 am, dn wrote: Whereas, creating a list (or tuple...) is legal because the structure's name is an "identifier"! No, the restriction only applies to the LHS. The list construction is on the RHS. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Get a Joke in Python

2021-10-28 Thread Greg Ewing
engineer sighs "not again". Orders NaN beers and -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-12 Thread Greg Ewing
have to give us more details. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-13 Thread Greg Ewing
at it was. You'll have to capture it earlier in the process somehow and pass it to where it's needed. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-20 Thread Greg Ewing
very common for handheld calculators to work in decimal. Most of HP's classic calculators used a CPU that was specifically designed for doing BCD arithmetic, and many versions of it didn't even have a way of doing arithmetic in binary! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-21 Thread Greg Ewing
bit words (14 BCD digits), and the instructions had options for operating on various fields of a floating-point number (mantissa, exponent, sign, etc.) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Negative subscripts

2021-11-26 Thread Greg Ewing
] >>> def f(x): return l[:-x or None] ... >>> f(3) ['a', 'b'] >>> f(2) ['a', 'b', 'c'] >>> f(1) ['a', 'b', 'c', 'd'] >>> f(0) ['a', 'b', 'c', 'd', 'e'] -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: problem reading a CSV file

2021-12-13 Thread Greg Ewing
On 14/12/21 7:07 am, MRAB wrote: It's difficult to say what the problem is when you haven't given us the code! Note: Attachments do not make it to this list. You will need to insert the code into the message as text. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Installation problems

2021-12-13 Thread Greg Ewing
ng it with sufficient privileges to put them in the shared area? Are you sure that your users are running the same Python that you installed? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: What to write or search on github to get the code for what is written below:

2022-01-13 Thread Greg Ewing
! But at least they'll be free of charge! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Writing a string with comma in one column of CSV file

2022-01-16 Thread Greg Ewing
double the double-quote. Another quirk is that Excel allows newlines in a quoted field, which causes problems for naive parsers that split the input into lines first and then analyse it into fields. (A particular non-Python one I use professionally is guilty of this...) -- Greg -- https://mail.

Re: Puzzling behaviour of Py_IncRef

2022-01-20 Thread Greg Ewing
tance, Py_RETURN_NONE will incref None and then > return it. > The OP understands that this is not a normal thing to do. He's trying to deliberately leak a reference for the purpose of diagnosing a problem. It would be interesting to see what the actual refcount is after calling this fu

Re: Puzzling behaviour of Py_IncRef

2022-01-26 Thread Greg Ewing
turn convention. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Pypy with Cython

2022-02-03 Thread Greg Ewing
er your OS provides (e.g. the "time" shell command in unices). -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to check if there is internet?

2022-02-07 Thread Greg Ewing
loyed. Or the internet acquires a new protocol that's designed for very-long-latency connections. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Why does not Python accept functions with no names?

2022-02-20 Thread Greg Ewing
nd to *any* name. The thing you're proposing wouldn't be anonymous -- it would have a name, that name being the empty string. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Threading question .. am I doing this right?

2022-02-25 Thread Greg Ewing
skip waiting altogether and immediately return None. * Also if the first call to get_data() times out it will return None (although maybe that's acceptable if the caller is expecting it). * The caller of get_data() is getting an object that could be changed under it by a future update. --

Re: Best way to check if there is internet?

2022-02-25 Thread Greg Ewing
On 26/02/22 11:22 am, Chris Angelico wrote: What's the best language for swearing in? Ah, that one I can't help you with, although I've heard good things about French. :) Russian seems to be quite good for it too, judging by certain dashcam footage channels. -- Greg -- https://

Re: SQLAlchemy: JSON vs. PickleType vs. raw string for serialised data

2022-02-28 Thread Greg Ewing
ned to use JSON if the data is something that can be easily represented that way. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Behavior of the for-else construct

2022-03-03 Thread Greg Ewing
it's up to the program to split it up how it wants. Different programs do that in different ways, hence the inconsistencies in how quoting and whitespace is handled. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Execute in a multiprocessing child dynamic code loaded by the parent process

2022-03-06 Thread Greg Ewing
expect the kind of problem they're having. It could be argued that it's their responsibility to ensure that all the needed code is loaded into the subprocess. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Reportlab / platypus bug?

2022-03-15 Thread Greg Ewing
Canterbury recently started using a Microsoft thing for all its email, and it thinks a large proportion of messages in the Python mailing lists are Very Dangerous Phishing Emails and helpfully quarantines them for me behind a clunky web interface. :-( -- Greg -- https://mail.python.org/mailman

<    1   2   3   4   5   6   7   8   9   10   >