Re: try..except or type() or isinstance()?

2020-08-14 Thread Peter Otten
Chris Angelico wrote: > On Sat, Aug 15, 2020 at 3:36 PM Manfred Lotz wrote: >> >> I have an object which I could initialize providind an int or a str. >> >> I am not sure which of the following is best to use >> - try/except >> - if type(int)... >> - if isinstance(v, int) >> >> Here a minimal

Re: try..except or type() or isinstance()?

2020-08-14 Thread Chris Angelico
On Sat, Aug 15, 2020 at 3:36 PM Manfred Lotz wrote: > > I have an object which I could initialize providind an int or a str. > > I am not sure which of the following is best to use > - try/except > - if type(int)... > - if isinstance(v, int) > > Here a minimal example > > def get_id(fromname):

try..except or type() or isinstance()?

2020-08-14 Thread Manfred Lotz
I have an object which I could initialize providind an int or a str. I am not sure which of the following is best to use - try/except - if type(int)... - if isinstance(v, int) Here a minimal example def get_id(fromname): # do something with `fromname` return 0 def get_name(fromid):

Re: How to install your personal module/package on site.

2020-08-14 Thread dn via Python-list
On 14/08/2020 22:32, Antoon Pardon wrote: Well the question is in the subject. I have a number of modules/packages which were until recently personal use only. However python is getting more popular at work and some of my work was considered useful enough to install in a public available spot.

Re: How to install your personal module/package on site.

2020-08-14 Thread Marco Sulla
https://www.google.com/search?channel=fs&client=ubuntu&q=publish+python+code First result. -- https://mail.python.org/mailman/listinfo/python-list

How to install your personal module/package on site.

2020-08-14 Thread Antoon Pardon
Well the question is in the subject. I have a number of modules/packages which were until recently personal use only. However python is getting more popular at work and some of my work was considered useful enough to install in a public available spot. How should I approach this? -- Antoon. --