Re: Friday finking: TDD and EAFP

2019-11-18 Thread boB Stepp
On Mon, Nov 18, 2019 at 3:23 PM Peter J. Holzer wrote: > > I don't know what "proper" TDD is (and even less "proper consideration" > of TDD), but TDD is in my opinion very much rooted in the agile mindset. > And that means frequent iteration and improvement. So I think the > micro-iteration techni

Any socket library to communicate with kernel via netlink?

2019-11-18 Thread lampahome
As title, I tried to communicate with kernel via netlink. But I failed when I receive msg from kernel. The weird point is sending successfully from user to kernel, failed when receiving from kernel. So I want to check code in 3rd library and dig in, but always found library called netlinkg but it

Re: Writing a CPython extension - calling another sibbling method ?

2019-11-18 Thread Michael Torrie
On 11/18/19 1:15 PM, R.Wieser wrote: > The thing is that the arguments of py_proc1 and py_proc2 are the same, but > for a single argument. Does this have to be done in the C API? Depending on how this class is used in your Python code, I would just create a new Python class that extends this cla

Re: Friday finking: TDD and EAFP

2019-11-18 Thread Mark Turner
> On Nov 18, 2019, at 4:07 PM, Peter J. Holzer wrote: > > On 2019-11-13 15:16:55 +1300, DL Neil via Python-list wrote: >> On 4/11/19 9:44 AM, Peter J. Holzer wrote: >>> TDD does in my opinion encourage EAFP thinking. >>> >>> The TDD is usually: >>> >>> 1 Write a test >>> 2 Write the m

Re: Launching a Script on the Linux Platform

2019-11-18 Thread Wildman via Python-list
On Mon, 18 Nov 2019 22:15:31 +0100, Peter J. Holzer wrote: > On 2019-11-18 15:01:57 -0600, Wildman via Python-list wrote: >> On Tue, 19 Nov 2019 05:09:07 +1100, Chris Angelico wrote: >> > On Tue, Nov 19, 2019 at 5:06 AM Wildman via Python-list >> > wrote: >> >> On Sun, 17 Nov 2019 18:27:45 +,

Re: How to delay until a next increment of time occurs ?

2019-11-18 Thread Peter J. Holzer
On 2019-11-15 12:11:31 +0100, R.Wieser wrote: > Dennis, > > No, that addition is a fixed increment on the initial starting > > time, and is NOT relative to the ending of a sleep. > > > No, that addition is a fixed increment > > Yep. > > > on the initial starting time > > Nope. > > If pythons s

Re: Friday finking: TDD and EAFP

2019-11-18 Thread Peter J. Holzer
On 2019-11-13 15:16:55 +1300, DL Neil via Python-list wrote: > On 4/11/19 9:44 AM, Peter J. Holzer wrote: > > TDD does in my opinion encourage EAFP thinking. > > > > The TDD is usually: > > > > 1 Write a test > > 2 Write the minimal amount of code that makes the test pass > > 3 If

Re: Launching a Script on the Linux Platform

2019-11-18 Thread Peter J. Holzer
On 2019-11-18 15:01:57 -0600, Wildman via Python-list wrote: > On Tue, 19 Nov 2019 05:09:07 +1100, Chris Angelico wrote: > > On Tue, Nov 19, 2019 at 5:06 AM Wildman via Python-list > > wrote: > >> On Sun, 17 Nov 2019 18:27:45 +, Barry Scott wrote: > >> > Because you are installing from a deb y

Re: Writing a CPython extension - calling another sibbling method ?

2019-11-18 Thread MRAB
On 2019-11-18 20:15, R.Wieser wrote: MRAB, One possibility is to refactor the code so that py_proc1 and py_proc2 themselves just handle their arguments and then call the function that does the actual work. The thing is that the arguments of py_proc1 and py_proc2 are the same, but for a singl

Re: Launching a Script on the Linux Platform

2019-11-18 Thread Wildman via Python-list
On Tue, 19 Nov 2019 05:09:07 +1100, Chris Angelico wrote: > On Tue, Nov 19, 2019 at 5:06 AM Wildman via Python-list > wrote: >> >> On Sun, 17 Nov 2019 18:27:45 +, Barry Scott wrote: >> >> >> On 12 Nov 2019, at 20:24, Wildman via Python-list >> >> wrote: >> >> >> >> Yes, I prefer to envoke e

Re: Writing a CPython extension - calling another sibbling method ?

2019-11-18 Thread R.Wieser
MRAB, > One possibility is to refactor the code so that py_proc1 and py_proc2 > themselves just handle their arguments and then call the function that > does the actual work. The thing is that the arguments of py_proc1 and py_proc2 are the same, but for a single argument. Which means that le

Re: Writing a CPython extension - calling another sibbling method ?

2019-11-18 Thread MRAB
On 2019-11-18 07:52, R.Wieser wrote: Hello all, I'm trying to edit a binary extension to Python, and have a situation where I would like to create method which adds a single argument, and than jumps to / calls another method. Like this: static PyObject *py_proc1(PyObject *self, PyObject *args)

Re: Launching a Script on the Linux Platform

2019-11-18 Thread Chris Angelico
On Tue, Nov 19, 2019 at 5:06 AM Wildman via Python-list wrote: > > On Sun, 17 Nov 2019 18:27:45 +, Barry Scott wrote: > > >> On 12 Nov 2019, at 20:24, Wildman via Python-list > >> wrote: > >> > >> Yes, I prefer to envoke env in the shebang line instead of > >> depending on the path. Paths c

Re: Launching a Script on the Linux Platform

2019-11-18 Thread Wildman via Python-list
On Sun, 17 Nov 2019 18:27:45 +, Barry Scott wrote: >> On 12 Nov 2019, at 20:24, Wildman via Python-list >> wrote: >> >> Yes, I prefer to envoke env in the shebang line instead of >> depending on the path. Paths can change especially in a >> multi-user system but env will always know where

Re: revise "([^/]+)$" into '([^/]+)$' in a lot of files under a directory.

2019-11-18 Thread Pieter van Oostrum
Hongyi Zhao writes: > On Sun, 17 Nov 2019 20:28:55 +0100, Pieter van Oostrum wrote: > >> To be honest, I myself would use Emacs, with rgrep and wgrep to do this. > > Are these tools superior to grep? They are based on grep. But rgrep does a grep through a whole directory tree, or a selection th