Re: An I connected here?

2020-07-17 Thread Rhodri James
On 17/07/2020 20:12, J. Pic wrote: And Hollidays ;) Nah, that's next week ;-) Le ven. 17 juil. 2020 à 21:03, Rhodri James a écrit : On 17/07/2020 19:33, Steve wrote: Sorry folks, I really messed that one up. I tried to doctor up a reply to get the address correct but failed to d

Re: An I connected here?

2020-07-17 Thread Rhodri James
t sufficiently intrigued to go find out about. I think there are fewer experts with time lurking around here (and I don't count myself as one of those, TBH). Recent controversies and the attempts to moderate them have probably upset quite a lot of people one way or another. -- Rhodri James

Re: Formal Question to Steering Council (re recent PEP8 changes)

2020-07-05 Thread Rhodri James
On 04/07/2020 16:38, Random832 wrote: On Fri, Jul 3, 2020, at 08:48, Rhodri James wrote: As I said in my preamble, it doesn't matter whether you believe that is true or think it's utter bollocks. I asked the question to get the Steering Council's opinion, not anyone

Re: New to python - Just a question

2020-07-03 Thread Rhodri James
Python, you can read a file one line at a time, so how to count the number of lines in a file should be pretty obvious. Figuring out how to do that for every *.cpp file in a directory will involve looking through the standard library, or getting a bash script to do it for you :-) -- Rhodri J

Re: Formal Question to Steering Council (re recent PEP8 changes)

2020-07-03 Thread Rhodri James
On 03/07/2020 15:28, Jon Ribbens via Python-list wrote: On 2020-07-03, Rhodri James wrote: On 02/07/2020 23:46, Random832 wrote: On Thu, Jul 2, 2020, at 18:29, Michael Torrie wrote: Come again? I can see no other link in the verbage with the "relics of white supremacy" that she r

Re: Formal Question to Steering Council (re recent PEP8 changes)

2020-07-03 Thread Rhodri James
at is true or think it's utter bollocks. I asked the question to get the Steering Council's opinion, not anyone else's. If you collectively really must rehash the arguments again, please have the decency to do so in a different thread. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Formal Question to Steering Council (re recent PEP8 changes)

2020-07-02 Thread Rhodri James
or do not give a monkey's, should _any_ political opinion be in the repo? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Formal Question to Steering Council (re recent PEP8 changes)

2020-07-02 Thread Rhodri James
ons. I mention this merely to reinforce the idea that these things are still answers as well as hostages to fortune. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Code of Conduct address "hold message"

2020-06-30 Thread Rhodri James
On 30/06/2020 15:25, Rhodri James wrote: Having just had occasion to use the code of conduct link (conduct...@python.org), I got back the message:   Your mail to 'conduct...@python.org' with the subject       Is being held until the list moderator can review it for approval

Code of Conduct address "hold message"

2020-06-30 Thread Rhodri James
nature of Thank you for your email about "". We will deal with it as soon as we can." Plus the usual platitudes about valuing my input and appreciating my custom which don't necessarily apply here ;-/ Any chance of getting the message altered to something a bit more fr

Re: Pycharm offers only implementation of an abstract getter but not an abstract setter

2020-06-25 Thread Rhodri James
On 24/06/2020 22:46, zljubi...@gmail.com wrote: Why Pycharm didn't offer a setter as well as getter? This is a general Python mailing list. If you have specific questions/complaints about PyCharm, they are probably better addressed directly to the makers of PyCharm. -- Rhodri

Re: Python-list Digest, Vol 201, Issue 9

2020-06-09 Thread Rhodri James
en insert it into the __dict__ as 'from', although a custom serializer would probably be preferable from a design standpoint. Might it be simpler to use a dict from the start? You could have a dictionary key of "from" without any problems. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Can't download Pygame and Pgzero

2020-06-05 Thread Rhodri James
. Which version of Windows are you using? What exactly did you do to install Pygame and Pgzero, in order, and what exactly went wrong. Please copy and paste any error messages, don't send screenshots because the mailing list will strip them off and we won't see them. -- Rhodri

Re: Friday Finking: Imports, Namespaces, Poisoning, Readability

2020-06-05 Thread Rhodri James
ore likely to change my own module to fit :-) - do you prefer PSL's importlib over Python's native import-s, for one of these (or any other) reason? Um, why would I? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Binary Sort on Python List __xor__

2020-06-01 Thread Rhodri James
ense whatsoever for lists like ["The", "quick", "brown", "fox"]. There's a decent purpose for a class implementing the features you want, but I honestly don't think the generic list class is it. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: .dll problem

2020-05-29 Thread Rhodri James
oogle turns up when you search for "windows runtime missing" explains what's going on and points to this link. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Behaviour of os.path.join

2020-05-27 Thread Rhodri James
t they expect). I'm faintly gobsmacked that anyone expects something like that to work. If you want a directory, create it. That's what os.mkdir (and the pathlib equivalent) is for. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Behaviour of os.path.join

2020-05-27 Thread Rhodri James
ade without a significant number of complaints (as in I can't remember the last one, and I've been around here for a while -- it's too hot for me to want to go hunt in the archives :-). How are these unexpected extensionless files getting created? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Behaviour of os.path.join

2020-05-27 Thread Rhodri James
ing on the filing system. Anything else is, as you have discovered, error-prone. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Behaviour of os.path.join

2020-05-26 Thread Rhodri James
documentation says, "If a component is an absolute path, all previous components are thrown away and joining continues from the absolute path component." Since "\\" is an absolute path component, all the previous components are thrown away and you are left with just "\\". -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Behaviour of os.path.join

2020-05-26 Thread Rhodri James
t; pathlib.PureWindowsPath('/').is_absolute() |False Thanks, that seems to suggest that there is an issue and that I should hence submit this as an issue. It is indeed most curious as to why this obviously absolute path is not recognised as such :-) -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: stderr writting before stdout

2020-05-25 Thread Rhodri James
On 24/05/2020 05:27, Souvik Dutta wrote: Is there any precedence or priority order by which sys.stderr.write() and sys.stdout.write() works. No. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Strings: double versus single quotes

2020-05-23 Thread Rhodri James
nt of view of someone who writes more C code than Python, not having to remember a new set of habits for Python makes life a lot simpler. Chacun à son goût and all that. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: why no camelCase in PEP 8?

2020-05-19 Thread Rhodri James
h the same difficulty really. I certainly don't find it "hard" to grep for _snake_case. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Installation Problem

2020-05-05 Thread Rhodri James
more detailed advice. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: python Netcdf and ncdump

2020-04-30 Thread Rhodri James
cdump. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: [RELEASE] Python 3.9.0a6 is now available for testing

2020-04-29 Thread Rhodri James
1 0 1 0 1 01 0 OK I don't see any violation of quoting or parentheses matching. Still trying to figure out what this lambda does. Presumably it's something to do with recognising string prefixes? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: What variable type is returned from Open()?

2020-04-17 Thread Rhodri James
On 17/04/2020 22:27, dcwhat...@gmail.com wrote: On Friday, April 17, 2020 at 2:11:17 PM UTC-4, Rhodri James wrote: And people wonder why I stick to gdb when at all possible :-) Never worked with it. Is it a debugger for compiled code, i.e. it steps through the executable while displaying the

Re: What variable type is returned from Open()?

2020-04-17 Thread Rhodri James
d useless bits of code to cast something to (uint8_t *) because I want to see the bytes and the IDE will not give up on trying to interpret them for me. And people wonder why I stick to gdb when at all possible :-) -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Floating point problem

2020-04-17 Thread Rhodri James
*binary* format, what constitutes an *exact* decimal may be a little surprising! -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: RFC: For Loop Invariants

2020-04-11 Thread Rhodri James
ou care enough, refactor it as a comprehension: count = sum(1 for a in chars if a in seek) It it's not so simple, neither the comprehension nor your proposal are going to be as readable as the twice nesting. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: How To Change Package Representation on Shell?

2020-04-01 Thread Rhodri James
on't think you can. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: How to instantiate a custom Python class inside a C extension?

2020-04-01 Thread Rhodri James
On 01/04/2020 18:24, Musbur wrote: Am 01.04.2020 15:01 schrieb Rhodri James: I believe you do it in C as you would in Python: you call the Series class! pyseries = PyObject_CallObject((PyObject *)&series_type, NULL); Well, that dumps core just as everything else I tried. What does

Re: How to instantiate a custom Python class inside a C extension?

2020-04-01 Thread Rhodri James
ieve you do it in C as you would in Python: you call the Series class! pyseries = PyObject_CallObject((PyObject *)&series_type, NULL); -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Like c enumeration in python3

2020-03-23 Thread Rhodri James
. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP Idea: Multi-get for lists/tuples and dictionaries (inspired in NumPy)

2020-03-19 Thread Rhodri James
On 19/03/2020 14:47, Peter J. Holzer wrote: On 2020-03-19 14:24:35 +, Rhodri James wrote: On 19/03/2020 13:00, Peter J. Holzer wrote: It's more compact, especially, if "d" isn't a one-character variable, but an expression: fname, lname = db[people].employe

Re: Why is the program not printing three lines?

2020-03-19 Thread Rhodri James
ance is created. Try running this code: class first: print("from first") Just that. No instantiation, no "first()", nothing else. Just the class suite itself. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP Idea: Multi-get for lists/tuples and dictionaries (inspired in NumPy)

2020-03-19 Thread Rhodri James
act. I think the second version is more readable (and the third version, where you factored out the common lookup is better still). -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Python question

2020-03-11 Thread Rhodri James
media app." Email works exceedingly well for this sort of thing, despite Google's antics. +10 The best response to "This system breaks when I abuse it" is almost always "Well stop abusing it then." -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: encapsulating a global variable

2020-02-26 Thread Rhodri James
from threading disasters by itself, though it will make it easier to protect it as you need. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: encapsulating a global variable

2020-02-25 Thread Rhodri James
or me since get_it(piece) returns the error: builtins.TypeError: get_it() takes no arguments It works for me (pace sticking something in GetIt.seen to avoid getting a KeyError). You aren't muddling up the class name and instance name are you? -- Rhodri James *-* Kynesim Lt

Re: encapsulating a global variable

2020-02-25 Thread Rhodri James
you have a global class instance hanging around, which is not actually any better than a global dictionary. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: time.localtime add a parameter for timezone

2020-02-24 Thread Rhodri James
ccasions when you want it, but more often you should be working in UTC not local time. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Paper Print Help

2020-02-20 Thread Rhodri James
On 20/02/2020 15:08, Duram wrote: On 19/02/2020 12:17, Rhodri James wrote: On 19/02/2020 14:22, Duram via Python-list wrote: I have a drawing in a .gif file with (a,b) pixels and want to paperprint it in a position (x,y), what would be the code? What have you tried? Nothing, I did not find

Re: Paper Print Help

2020-02-19 Thread Rhodri James
On 19/02/2020 14:22, Duram via Python-list wrote: I have a drawing in a .gif file with (a,b) pixels and want to paperprint it in a position (x,y), what would be the code? What have you tried? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Technical debt - was Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-12 Thread Rhodri James
On 12/02/2020 17:46, Python wrote: On Wed, Feb 12, 2020 at 01:16:03PM +, Rhodri James wrote: On 12/02/2020 00:53, Python wrote: In pretty much every job I've ever worked at, funding work (e.g. with humans to do it) with exactly and precisely the resources required is basically impos

Re: Technical debt - was Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-12 Thread Rhodri James
d to pay the cost of a replacement project, which will accrue its own technical debt... -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: ERROR in loading data

2020-02-04 Thread Rhodri James
on the interactive command line or a look in the documents will tell you that strings indeed do not have a loads_data() method. I don't know what library you are intending to use, but you need to open your file with that first. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: when uses time.clock,there are always mistakes

2020-02-03 Thread Rhodri James
ile "", line 1, in   t = time.clock()   AttributeError: module 'time' has no attribute 'clock' It is correct, there is no time.clock() function. The documentation is here: https://docs.python.org/3/library/time.html -- Rhodri James *-* Kynesim Ltd --

Re: Dynamic Data type assignment

2020-01-28 Thread Rhodri James
input, converts it to a string (stripping a trailing newline), and returns that. When EOF is read, EOFError is raised. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Friday Finking: Enum by gum

2020-01-24 Thread Rhodri James
quire that behaviour. It's horses for courses, as ever. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-ideas] Re: Enhancing Zipapp

2020-01-08 Thread Rhodri James
On 08/01/2020 18:08, many people wrote lots of stuff... Folks, could we pick one list and have the discussion there, rather than on both python-list and python-ideas? Getting *four* copies of Andrew's emails is a tad distracting :-) -- Rhodri James *-* Kynesim Ltd -- https://mail.pytho

Re: Python, Be Bold!

2020-01-06 Thread Rhodri James
s -- or lack of OSes -- which have no graphical interface). -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Python, Be Bold! - The Draft

2020-01-06 Thread Rhodri James
ft utterly irrelevant to me and those like me. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Dataset training using Kmeans

2020-01-06 Thread Rhodri James
you are far more likely than me to recognise which of them are relevant to your circumstances. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: hexdump module installation error

2019-12-19 Thread Rhodri James
7;hexdump.py': [Errno 2] No such file or directory user@USERnoMacBook-Air LibraBrowser % Huh. You've done a "pip3 install hexdump" so I don't know what might be happening here. Sorry. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: hexdump module installation error

2019-12-19 Thread Rhodri James
for that. c) I would much prefer it if you didn't top-post, but interleaved your replies like I've done here. I find it hard to follow top-posted messages because they reverse the normal flow of conversation. On Wed, Dec 18, 2019 at 11:39 PM Rhodri James wrote: On 18/12/2019 0

Re: hexdump module installation error

2019-12-18 Thread Rhodri James
aw it. Could you copy and paste (DON'T retype!) the error instead, so we can all read it? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-12 Thread Rhodri James
It doesn't. This happens to be the behaviour in CPython, but other implementations vary as Chris has explained several times now. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-11 Thread Rhodri James
have further-reaching implications for those implementations. I can't speak to the details; the only other implementation I use is Micropython, and I don't use that often enough to have cared about the details of garbage collection beyond noting that it's different to CPython. -- Rho

Re: Python3 - How do I import a class from another file

2019-12-10 Thread Rhodri James
's an implementation detail of your computer. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-10 Thread Rhodri James
On 10/12/2019 19:00, R.Wieser wrote: MRAB, You merely disabled the mark-and-sweep collector. Nope. Go check the docs on "gc" Yep. Go and check the docs on "gc" *carefully* *plonk* -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-10 Thread Rhodri James
rt of space before deleting the object, for example, which might not happen until your script terminates. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Randomizing Strings In A Microservices World

2019-12-10 Thread Rhodri James
an individual machine) to each service. So do that, using whatever digits you have left after the unique machine number. * Mash these two numbers into a single ten digit identifier. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Regarding problem in python 3.8.0 installation

2019-12-09 Thread Rhodri James
.. I'm afraid this is a text-only mailing list, so your screenshot has been stripped off before any of us could see it. Please could you copy and paste the text of the error message you receive. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: ImportError: No module named Adafruit_SSD1306 Update

2019-12-05 Thread Rhodri James
On 05/12/2019 19:30, Rhodri James wrote: On 05/12/2019 18:49, RobH wrote: Update: I did python3 Internet.py and now only get this error: pi@raspberrypi:~/Downloads $ python3 Internet.py    File "Internet.py", line 24 font = ImageFont.truetype( 'Minec

Re: ImportError: No module named Adafruit_SSD1306 Update

2019-12-05 Thread Rhodri James
wn about this, and demand that we use either all tabs or all spaces for our indentation. That's what you've fallen foul off; there must be a mix of tabs and spaces in that line! -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: nonlocal fails ?

2019-11-14 Thread Rhodri James
al_variable = n love_my_global(3) # prints 'It was 5' show_my_global() # prints '3' -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: nonlocal fails ?

2019-11-14 Thread Rhodri James
scope *excluding globals.*" (my emphasis.) MyVar is a global here, so nonlocal explicitly doesn't pick it up. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Launching a Script on the Linux Platform

2019-11-12 Thread Rhodri James
The original idea of the shebang line invoking env, as far I recall, was that you'd get the "proper" system python3 wherever it had been put rather than something random and possibly malicious. I guess that means to go for your first option. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Using Makefiles in Python projects

2019-11-12 Thread Rhodri James
eemed that worthwhile. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Using Makefiles in Python projects

2019-11-11 Thread Rhodri James
o tell!) Trying to work cross-platform with NMake/GNU make is every bit as horrid as you're imagining when you start getting clever, and I haven't tried doing it for years. Generally when I'm working on both Windows and Linux, Cygwin is involved anyway so I just use GNU mak

Re: Using Makefiles in Python projects

2019-11-11 Thread Rhodri James
ke that comes with Visual Studio, for example, and use it in preference to the IDE when I can. Yes, it's a hassle, but it's a hassle you're going to go through anyway. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Syntax Suggestion: Pass Function Definition as Argument

2019-11-11 Thread Rhodri James
is probably right, but this is a toy example and just as easily written with lambdas if you're that worried about using up names. -10 from me. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: How execute at least two python files at once when imported?

2019-11-06 Thread Rhodri James
, but still requires a lot of careful thought. For example you've asserted that the modules you want to import simultaneously, but you also need to consider the import mechanism itself. Put 1 and 2 together, and multi-threaded import sounds like a nightmare. -- Rhodri James *-* Kynesi

Re: How execute at least two python files at once when imported?

2019-11-06 Thread Rhodri James
On 06/11/2019 11:42, Rhodri James wrote: On 06/11/2019 09:51, Spencer Du wrote: On Tuesday, 5 November 2019 19:44:46 UTC+1, Rhodri James  wrote: On 05/11/2019 18:33, Spencer Du wrote: I want to execute at least two python files at once when imported but I dont know how to do this. Currently I

Re: How execute at least two python files at once when imported?

2019-11-06 Thread Rhodri James
On 06/11/2019 09:51, Spencer Du wrote: On Tuesday, 5 November 2019 19:44:46 UTC+1, Rhodri James wrote: On 05/11/2019 18:33, Spencer Du wrote: I want to execute at least two python files at once when imported but I dont know how to do this. Currently I can only import each file one after

Re: How execute at least two python files at once when imported?

2019-11-05 Thread Rhodri James
would you want to do this? What exactly does "at the same time" mean here? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: __instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-05 Thread Rhodri James
On 04/11/2019 22:23, Peter J. Holzer wrote: On 2019-11-04 14:54:23 +, Rhodri James wrote: On 04/11/2019 14:33, Veek M wrote: __metaclass__ = whatever; # is python2.x syntax But not Python3: see PEP 3115 Doesn't "X is python2.x syntax" imply "X is not python3 syntax

Re: __instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-04 Thread Rhodri James
ust be what's responsible for the True result. Logically the problem must be to do with your MyzMeta class then. I have no idea what. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: __instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-04 Thread Rhodri James
Meta): pass then you get the prints from MyMeta.__instancecheck__(). The isinstance() still returns True, though, and I don't know why. Then again, your definition of MyMeta is really weird. f = Foo() b = Bar() print(isinstance(f, (Bar, Foo))) -- Rhodri James *-* Kynesim Ltd

Re: OOP - iterable class: how to delete one of its objects ?

2019-11-04 Thread Rhodri James
t the reference count" existed.Thank you. Could cause some interresting "the object has disappeared!" problems when you're not carefull with it though ... :-) Yes, it can. That's why you want to create a finalizer to tidy up. -- Rhodri James *-* Kynesim Ltd -- h

Re: OOP - iterable class: how to delete one of its objects ?

2019-11-01 Thread Rhodri James
reference count. This won't automatically delete the reference from the WeakSet when the instance goes away, you'll want to set a finalizer for that, but the documentation covers what you want to know fairly clearly. Trust me, I was doing exactly this a week or so ago, and it

Re: Calculations and Variables

2019-11-01 Thread Rhodri James
On 01/11/2019 17:07, MRAB wrote: On 2019-11-01 12:36, Rhodri James wrote: On 31/10/2019 20:14, MRAB wrote: On 2019-10-31 18:46, ferzan saglam wrote: The code below which I have written should print the result of 43.6 with the given values I have included at the end of this question, but for

Re: Calculations and Variables

2019-11-01 Thread Rhodri James
ython3. So my first piece of advice would be to switch to Python3 now so you don't have to re-learn oddities like input(), print() and string handling. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Black

2019-10-21 Thread Rhodri James
#x27;s my personal preference. (Which indicates that I too shouldn't consider using black!) -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Instantiating sub-class from super

2019-10-15 Thread Rhodri James
find many and varied ways of coming back to bite you? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Curious about library inclusion

2019-10-15 Thread Rhodri James
On 15/10/2019 12:38, Antoon Pardon wrote: On 11/10/19 15:48, Rhodri James wrote: On 10/10/2019 12:40, Antoon Pardon wrote: About including piped iterators: http://code.activestate.com/recipes/580625-collection-pipeline-in-python/ On 10/10/19 13:00, Paul Moore wrote: As another measure

Re: Error: thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable t

2019-10-11 Thread Rhodri James
On 11/10/2019 15:13, Prabakaran Hadoop wrote: Thanks for your reply. Any work around or any other way to achieve from python to prestosql . If there is, it'll be in the GitHub issue I linked to. I just applied Google to your question. -- Rhodri James *-* Kynesim Ltd --

Re: Curious about library inclusion

2019-10-11 Thread Rhodri James
overall into what this line means in particular. It's exactly like coming across an unusual phrasing or iffy grammar in a piece of writing; you get thrown out of the reading experience by having to concentrate on the individual words. Heh. Literary criticism as applied to programming. Only

Re: Error: thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable t

2019-10-11 Thread Rhodri James
sage=("Could not start SASL: %s" % self.sasl.getError())) thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable to find a callback: 2' I am trying to connect from windows 10 local to Pre

Re: Would you be interested in this Python open source project?

2019-10-08 Thread Rhodri James
spaces will probably be more enthusiastic. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: pathlib

2019-10-02 Thread Rhodri James
ame, just one that may transiently be related to a real object. Concrete may not be the best term for this, but I can't think of a better one. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Recursive method in class

2019-10-01 Thread Rhodri James
.factorial(n - 1) instance = Dummy() instance.factorial(3) 6 # correct So, to summarize, if you create a class with type(name, bases, dict_) or with the "class" keyword, recursive methods can't be writen in the same way. This is what puzzle me. On the contrary, recursive methods are

Re: pathlib

2019-10-01 Thread Rhodri James
home/rhodri/foo.txt: No such file or directory cat "concatenates files" to quote its man page. Does that mean it creates them if they don't exist, just because I typed the name into the command? No. I wouldn't expect it either. In exactly the same way I don't e

Re: Recursive method in class

2019-09-27 Thread Rhodri James
Try self.fib(...) instead of fib(self, ...) both times. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: __init__ is not invoked

2019-09-26 Thread Rhodri James
On 26/09/2019 15:35, Oscar Benjamin wrote: On Thu, 26 Sep 2019 at 13:39, Rhodri James wrote: You have returned the class object, not an instance of anything, Well object is an instance of object as well as of type: Fair point. I keep forgetting that. -- Rhodri James *-* Kynesim Ltd

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-26 Thread Rhodri James
of your message to overwrite the characters you don't want any more, but not so many that you overwrite what you want to keep. Working out how many spaces that is for any given message could be quite tedious. You may well find it easier to lcd.clear() the whole display and rewrite everything when you want to change anything. Anyway, I hope that helps. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: __init__ is not invoked

2019-09-26 Thread Rhodri James
p of that, the language definition states that "The return value of __new__() should be the new object instance (usually an instance of cls)". You have returned the class object, not an instance of anything, so on the whole it's lucky that object.__init__() does nothing! -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Function to call a extern command as a filter

2019-09-25 Thread Rhodri James
nice: I would like to avoid the extra steps writing an reading extern files. subprocess is your friend here. Something like: [snip myself] You can also use the io.StringIO class of the stdlib, which is more suitable for this use case. Not for running external tools, surely? -- Rhodri James

  1   2   3   4   5   6   7   8   9   >