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: 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: 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: 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: 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: 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: 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: 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: 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: 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
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: 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: 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
and g represent? -- 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: 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: 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-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-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
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

(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: 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 --

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: 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-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
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
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-24 Thread Greg Ewing
t; int = 42 >>> int 42 >>> __builtins__.int >>> -- 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: 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: 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: 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: 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: 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: 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: 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: 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: 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
ch it. -- 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: 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: 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-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-16 Thread Greg Ewing
urpose of stdio buffering. -- 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: 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
o interact badly with Python stdio. Can something be done about this? Maybe Python stdio objects should flush all the C stdio streams before writing anything? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: conceptual problem (was: A beginning beginner's question about input, output and . . .

2021-01-14 Thread Greg Ewing
ge. So get and set methods are unnecessary and actively discouraged in Python. (C#, if I understand correctly, gets this sort of half-right. You can turn an attribute into a property, and the calling *source* doesn't change, but it all has to be recompiled -- which kind of defeats the purpose.)

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

2021-01-14 Thread Greg Ewing
ng as sqrt, but the sqrt function probably uses a more efficient algorithm. Also, exponentiation assumes you're okay with getting a complex result: >>> (-27)**0.5 (3.181725716174721e-16+5.196152422706632j) So it's not quite the same thing as math.sqrt(). -- Greg -- https:/

Re: Application window geometry specifier

2021-01-13 Thread Greg Ewing
;t see any harm in allowing the app to *request* (not force) a certain position for a window. The app can of course abuse that privilege, but that's the fault of the app, not the feature. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Greg Ewing
On 14/01/21 11:09 am, Grant Edwards wrote: Perhaps I need to recalibrate my adjectives, but with 256KB+ of flash and 32KB+ of RAM, I wouldn't call them "small" It's small by today's standards, when you consider that multiple GB of RAM is commonplace now in most &

Re: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Greg Ewing
On 13/01/21 7:57 pm, Christian Gollwitzer wrote:  What do you mean, "until" ? https://medium.com/@yon.goldschmidt/running-python-in-the-linux-kernel-7cbcbd44503c He's using Micropython. That's cheating! :-) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Greg Ewing
On 13/01/21 4:18 am, Grant Edwards wrote: AFAIK, Python can't be used to write device drivers for any popular OS At least not until some crazy person embeds Python in the Linux kernel... -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: argparse presence of switch

2021-01-12 Thread Greg Ewing
ment following -r containing a value. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Greg Ewing
ard python distribution, gives low-level access to C library functions). -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python building 2nd app, need advices

2021-01-11 Thread Greg Ewing
look right to you, it may be the fault of whatever you're using to read the group. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: binascii.b2a vs ord()

2021-01-10 Thread Greg Ewing
"credits" or "license" for more information. >>> s = 'Hello World' >>> s 'Hello World' >>> b = s.encode('ascii') >>> b b'Hello World' >>> s2 = b.decode('ascii') >>> s2 'Hello World' -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python building 2nd app, need advices

2021-01-08 Thread Greg Ewing
On 9/01/21 12:10 pm, pascal z wrote: any way to attach a file because I loose indentation? Indentation usually makes it through here if you indent with spaces rather than tabs. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: dayofyear is not great when going into a new year

2021-01-08 Thread Greg Ewing
On 9/01/21 11:17 am, Martin Schöön wrote: "regardless of what you have been told, recreational use of mathematics is harmless" I hope that is true for recreational programming as well :-) Mostly harmless, but it can be addictive! -- Greg -- https://mail.python.org/mailman/listi

Re: primitive password cracker

2021-01-07 Thread Greg Ewing
x27;b', 'c'], 3, [], words) print(words) For this particular problem it's less efficient than the technique used by itertools.product, because it generates sub-combinations multiple times. However, it's a useful technique to keep in mind whenever you have a "variable number o

Re: Control stript which is runing in background.

2021-01-02 Thread Greg Ewing
On 3/01/21 12:30 am, Alan Bawden wrote: So as long as the OP's commands are no longer than 512 bytes, and as long as they are careful to send commands in a single call to write(), Also note that's one write() system call, which may or may not correspond to one Python write() call

Re: Lambda in parameters

2020-12-19 Thread Greg Ewing
g but functions. This is mainly of theoretical interest; it's not usually a practical way to go about things. But it's a good exercise in thinking about functions as objects to be manipulated. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: dict.get(key, default) evaluates default even if key exists

2020-12-17 Thread Greg Ewing
macros effectively let you do something similar. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Returning from a multiple stacked call at once

2020-12-12 Thread Greg Ewing
the limit is about 1000. So if you have a large graph with a path more than 1000 steps long, you can hit the recursion limit. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: list[type, type, ...] ?!

2020-12-03 Thread Greg Ewing
nterpreter? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: list[type, type, ...] ?!

2020-12-03 Thread Greg Ewing
ntics with respect to particular types -- that's left to the type checkers. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Why can't numpy array be restored to saved value?

2020-11-25 Thread Greg Ewing
gives you another view of the underlying data. This is a trap you need to watch out for, since it's different from the way sequences normally behave in Python. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Environment vars

2020-11-25 Thread Greg Ewing
ery different things... -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: GUI: I am also looking for a nudge into the best (GUI) direction.

2020-11-01 Thread Greg Ewing
of the standard offerings from Microsoft such as WinForms rather than rolling your own. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: GUI: I am also looking for a nudge into the best (GUI) direction.

2020-10-31 Thread Greg Ewing
en changes occur. On the other hand, if the toolkit wraps the platform's native widgets, it gets all the correct appearance and behaviour, and automatically tracks changes. For these reasons I regard "uses native widgets" as a mark of quality for a toolkit. -- Greg -- https://mail.py

Re: Covariance matrix syntax

2020-10-24 Thread Greg Ewing
ed=True does *not* make your result biased -- quite the contrary!) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Question on ABC classes

2020-10-22 Thread Greg Ewing
actually do any harm if someone instantiated your base class? If not, then it's probably not worth going out of your way to prevent it. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Subprocess Connection Error

2020-10-17 Thread Greg Ewing
ve you tried using a different name, such as "my_types.py"? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-27 Thread Greg Ewing
had this way of using "pass" in mind. More likely they're just trying to be helpful and save you from having to manually unindent in a few rare situations. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: List Partition Comprehension (Feature Suggestion)

2020-09-22 Thread Greg Ewing
so rarely needed. Although it probably wouldn't be as fast as an LC could potentially be, due to the need to call a user-supplied function for every item. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Puzzling difference between lists and tuples

2020-09-20 Thread Greg Ewing
chine it seems to be about 17 times slower than using a trailing comma: >>> timeit.repeat("tuple(['first'])") [0.1774688908953, 0.1768788059062, 0.1768771102082, 0.176763284033, 0.17684489200001963] >>> timeit.repeat("('first',)") [0.0117392889055, 0.01156933400708, 0.01158800017473, 0.01156976132486, 0.01157938358281] -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: importlib changes from py3.7 to py3.8

2020-09-19 Thread Greg Ewing
empty __init__.py in Python 3.8 and there was no problem: % ls -l empty total 0 -rw-r--r-- 1 greg staff 0 20 Sep 12:00 __init__.py % python3 Python 3.8.2 (default, Mar 23 2020, 11:36:18) [Clang 8.1.0 (clang-802.0.42)] on darwin Type "help", "copyright", "credits"

Re: Puzzling difference between lists and tuples

2020-09-18 Thread Greg Ewing
normal brackets, but there are a few interesting ones, such as LEFT/RIGHT WHITE/BLACK LENTICULAR BRACKET and LEFT/RIGHT TORTOISE SHELL BRACKET. 〖 〗【 】〔 〕 -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Symlinks already present

2020-09-03 Thread Greg Ewing
ue >>> os.lstat('test2/spam/..').st_ino == os.lstat('test2').st_ino True What happens if you go one level deeper? I.e. is os.lstat('test1/spam/eggs/../..').st_ino == os.lstat('test1').st_ino and os.lstat('test2/spam/eggs/../..').st_ino == os.lstat('test2').st_ino ? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-08-26 Thread Greg Ewing
On 23/07/20 12:23 pm, dn wrote: You be sure to have a nice day, now! How do you feel about you be sure to have a nice day, now? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: print() ignores context ?

2020-05-05 Thread Greg Ewing
nding mode for floats. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: python read line by line and keep indent

2020-04-17 Thread Greg Ewing
so that you keep whatever indentation the line had before. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to inheret a metaclass.

2020-04-10 Thread Greg Ewing via Python-list
't specify a metaclass. I find it peculiar that you can give a function as metaclass. Yes, it just calls whatever object you give it, which allows for various fun things. You'd be risking a lynching if you took advantage of it for anything important, though.:-) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: How does the super type present itself and do lookups?

2020-03-24 Thread Greg Ewing
7;, '__init__', '__new__', '__thisclass__', '__self__', '__self_class__', '__doc__'] from which it's clear that the super object overrides __getattribute__ but not __getattr__. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: `async def` breaks encapsulation?

2020-03-23 Thread Greg Ewing
*should* be eliminated, before thinking about how to achieve it. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.8.2 on MacOSX Sierra?

2020-03-22 Thread Greg Ewing
On 22/03/20 10:20 pm, Greg Ewing wrote: I'm going to try again with XCode 8, which purportedly comes with a 10.12 SDK, and see if that fixes it. It does. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.8.2 on MacOSX Sierra?

2020-03-22 Thread Greg Ewing
version) but I think I'm being bitten by the same underlying issue. I'm going to try again with XCode 8, which purportedly comes with a 10.12 SDK, and see if that fixes it. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Python 3.8.2 on MacOSX Sierra?

2020-03-21 Thread Greg Ewing
bort trap: 6 Am I out of luck? Is Python 3.8 only intended work on very recent versions of MacOSX? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: How does the super type present itself and do lookups?

2020-03-19 Thread Greg Ewing
the tp_getattro type slot, which corresponds to __getattribute__. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: `async def` breaks encapsulation?

2020-03-17 Thread Greg Ewing
call a coroutine, so switching a function between coroutine and non-coroutine would still have just as much of a ripple effect on the rest of your code. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: encapsulating a global variable

2020-02-25 Thread Greg Ewing
ion, while ensuring that there really is only one instance, and making this fact clear to anyone reading the code. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: encapsulating a global variable

2020-02-25 Thread Greg Ewing
blems need to be addressed by appropriate use of locks, etc. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Asyncio question

2020-02-21 Thread Greg Ewing
e point of asyncio is to make tasks very lightweight, so you can use as many of them as is convenient without worries. One task per client sounds like the right thing to do here. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: JavaScript's void operator in Python?

2020-02-02 Thread Greg Ewing
On 3/02/20 3:38 am, Stefan Ram wrote: void( ( print( 2 ), print( 3 ))) If the functions you're calling all return None, you can do this: >>> print(2); print(3) 2 3 -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: How to read the original data line by line from stdin in python 3 just like python 2?

2020-01-28 Thread Greg Ewing
On 29/01/20 6:27 pm, Peng Yu wrote: Suppose that I use this to read from stdin. But `line` contains decoded data in python 3. In python 2, it contains the original data. What is the best way to get the original data in python 3? Read from stdin.buffer, which is a stream of bytes. -- Greg

Re: Nested Loop Code Help

2020-01-26 Thread Greg Ewing
ree assignment statements. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Sandboxing eval()

2020-01-21 Thread Greg Ewing
_']['__imp'+'ort__']", {"__builtins__":{}}) You can probably find a way to block that particular loophole. But then there will be another one, and another, and another... You'll never be sure that you've found all of them. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: IDLE, TCP/IP problem.

2020-01-16 Thread Greg Ewing
port from being opened. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

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