Re: Question on ABC classes

2020-10-22 Thread Julio Di Egidio
On Friday, 23 October 2020 07:36:39 UTC+2, Greg Ewing wrote: > On 23/10/20 2:13 pm, Julio Di Egidio wrote: > > I am now thinking whether I could achieve the "standard" > > behaviour via another approach, say with decorators, somehow > > intercepting calls to __new__... maybe. > > I'm inclined to

Re: Question on ABC classes

2020-10-22 Thread Greg Ewing
On 23/10/20 2:13 pm, Julio Di Egidio wrote: I am now thinking whether I could achieve the "standard" behaviour via another approach, say with decorators, somehow intercepting calls to __new__... maybe. I'm inclined to step back and ask -- why do you care about this? Would it actually do any ha

Re: Debugging a memory leak

2020-10-22 Thread Karen Shaeffer via Python-list
> On Oct 22, 2020, at 5:51 PM, Pasha Stetsenko wrote: > > Dear Python gurus, > > I'm a maintainer of a python library "datatable" (can be installed from > PyPi), and i've been recently trying to debug a memory leak that occurs in > my library. > The program that exposes the leak is quite simp

Re: GUI (tkinter) popularity and job prospects for

2020-10-22 Thread jfong
Lammie Jonson於 2020年10月23日星期五 UTC+8上午5時20分45秒寫道: > Thanks, > > Yes, I have some sense about how to do job interviews and market myself > which is always an ongoing process. > > I also just have an interest in different technologies that I may want to > investigate as I can get bored with cert

Re: Debugging a memory leak

2020-10-22 Thread Chris Angelico
On Fri, Oct 23, 2020 at 12:20 PM Pasha Stetsenko wrote: > I'm currently not sure where to go from here. Is there something wrong with > my python object that prevents it from being correctly processed by the > Python runtime? Because this doesn't seem to be the usual case of > incrementing the ref

Re: GUI (tkinter) popularity and job prospects for

2020-10-22 Thread Terry Reedy
On 10/22/2020 2:58 PM, Lammie Jonson wrote: I looked at tkinter which seems to have quite a few examples out there, but when I searched indeed.com for tkinter and wxpython it appeared that there was hardly any job listings mentioning those. Why is that ? I think that commercial desktop appli

Debugging a memory leak

2020-10-22 Thread Pasha Stetsenko
Dear Python gurus, I'm a maintainer of a python library "datatable" (can be installed from PyPi), and i've been recently trying to debug a memory leak that occurs in my library. The program that exposes the leak is quite simple: ``` import datatable as dt import gc # just in case def leak(n=10**

Re: GUI (tkinter) popularity and job prospects for

2020-10-22 Thread 2QdxY4RzWzUUiLuE
On 2020-10-22 at 12:50:43 -0700, Rich Shepard wrote: > On Thu, 22 Oct 2020, Lammie Jonson wrote: > > I looked at tkinter which seems to have quite a few examples out > > there, but when I searched indeed.com for tkinter and wxpython it > > appeared that there was hardly any job listings mentioni

Re: Question on ABC classes

2020-10-22 Thread Julio Di Egidio
On Thursday, 22 October 2020 23:04:25 UTC+2, Ethan Furman wrote: > On 10/22/20 9:25 AM, Julio Di Egidio wrote: > > > Now, I do read in the docs that that is as intended, > > but I am not understanding the rationale of it: why > > only if there are abstract methods defined in an ABC > > class is i

Re: GUI (tkinter) popularity and job prospects for

2020-10-22 Thread Lammie Jonson
Thanks, Yes, I have some sense about how to do job interviews and market myself which is always an ongoing process. I also just have an interest in different technologies that I may want to investigate as I can get bored with certain things a little at times. If some technology seems a lit

Re: GUI (tkinter) popularity and job prospects for

2020-10-22 Thread Chris Angelico
On Fri, Oct 23, 2020 at 8:39 AM Michael Torrie wrote: > > I was going to look at something like tensorflow perhaps, though I am > > not sure if machine learning is that easy to pickup or not > > Not sure anything difficult and worthwhile, even if it is popular and in > demand, is something you can

Re: GUI (tkinter) popularity and job prospects for

2020-10-22 Thread Michael Torrie
On 10/22/20 12:58 PM, Lammie Jonson wrote: > > I have been a rails developer as well as JS/react. I had wanted to > look at python a bit due to it's popularity. > > I looked at tkinter which seems to have quite a few examples out > there, but when I searched indeed.com for tkinter and wxpython it

Re: GUI (tkinter) popularity and job prospects for

2020-10-22 Thread Tal Einat
Hi Lammie, On Thu, Oct 22, 2020 at 10:03 PM Lammie Jonson wrote: > > I looked at tkinter which seems to have quite a few examples out there, > but when I searched indeed.com for tkinter and wxpython it appeared that > there was hardly any job listings mentioning those. Why is that ? > My guess

Re: GUI (tkinter) popularity and job prospects for

2020-10-22 Thread Rich Shepard
On Thu, 22 Oct 2020, Lammie Jonson wrote: I looked at tkinter which seems to have quite a few examples out there, but when I searched indeed.com for tkinter and wxpython it appeared that there was hardly any job listings mentioning those. Why is that ? It's a bit of a demotivating factor to get

Re: Question on ABC classes

2020-10-22 Thread Ethan Furman
On 10/22/20 9:25 AM, Julio Di Egidio wrote: Now, I do read in the docs that that is as intended, but I am not understanding the rationale of it: why only if there are abstract methods defined in an ABC class is instantiation disallowed? IOW, why isn't subclassing from ABC enough? Let's say yo

Re: Question on ABC classes

2020-10-22 Thread Marco Sulla
On Thu, 22 Oct 2020 at 22:09, Marco Sulla wrote: > Not sure because I never tried or needed, but if no @abstractsomething in > A is defined and your B class is a subclass of A, B should be an abstract > class, not a concrete class. > Now I'm sure: >>> from abc import ABC, abstractmethod >>> cla

Re: Question on ABC classes

2020-10-22 Thread Marco Sulla
On Thu, 22 Oct 2020 at 18:31, Julio Di Egidio wrote: > why > only if there are abstract methods defined in an ABC > class is instantiation disallowed? > Not sure because I never tried or needed, but if no @abstractsomething in A is defined and your B class is a subclass of A, B should be an abst

GUI (tkinter) popularity and job prospects for

2020-10-22 Thread Lammie Jonson
I have been a rails developer as well as JS/react. I had wanted to look at python a bit due to it's popularity. I looked at tkinter which seems to have quite a few examples out there, but when I searched indeed.com for tkinter and wxpython it appeared that there was hardly any job listings m

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Chris Angelico
On Fri, Oct 23, 2020 at 3:35 AM Grant Edwards wrote: > Moving from 2.x to 3.x isn't too bad, but trying to maintain > compatiblity with both is painful. At this point, I would probably > just abandon 2.x. > Definitely. No point trying to support both when you're starting with code from a Py3 exam

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Grant Edwards
On 2020-10-22, Chris Angelico wrote: > On Fri, Oct 23, 2020 at 12:15 AM Shaozhong SHI wrote: >> What should I know or watch out if I decide to move from Python 2.7 >> to Python 3? > > Key issues? Well, for starters, you don't have to worry about whether > your strings are Unicode or not. They ju

Question on ABC classes

2020-10-22 Thread Julio Di Egidio
Hello guys, I am professional programmer but quite new to Python, and I am trying to get the grips of some peculiarities of the language. Here is a basic question: if I define an ABC class, I can still instantiate the class unless there are abstract methods defined in the class. (In the typical

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Chris Angelico
On Fri, Oct 23, 2020 at 12:15 AM Shaozhong SHI wrote: > > Thanks, Chris. > > What should I know or watch out if I decide to move from Python 2.7 to Python > 3? > > What are the key issues? Syntax? > Keep it on-list please :) Key issues? Well, for starters, you don't have to worry about whether

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Marco Sulla
Never worked with ZFS, it sounds interesting. Anyway, IMHO it's much more simple to save to disk also for debugging: you have not to extract the data from the db if you need to inspect them. On Thu, 22 Oct 2020 at 14:39, D'Arcy Cain wrote: > On 10/22/20 7:23 AM, Marco Sulla wrote: > > I would ad

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread D'Arcy Cain
On 10/22/20 7:23 AM, Marco Sulla wrote: I would add that usually I do not recommend saving files on databases. I usually save the file on the disk and the path and mime on a dedicated table. I used to do that because backing up the database became huge. Now I use ZFS snapshots with send/recei

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Chris Angelico
On Thu, Oct 22, 2020 at 8:28 PM Shaozhong SHI wrote: > > I found this last option is very interesting. > > Saving the dataframe to memory using StringIO > > https://naysan.ca/2020/06/21/pandas-to-postgresql-using-psycopg2-copy_from/ > > But, testing shows > unicode argument expected, got 'str' > >

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Marco Sulla
I would add that usually I do not recommend saving files on databases. I usually save the file on the disk and the path and mime on a dedicated table. -- https://mail.python.org/mailman/listinfo/python-list

Static typing—with annotations—function name & arguments, or result of call, or string

2020-10-22 Thread Samuel Marks
From my understanding, `ast.arguments` and `inspect.Signature` are the two builtin ways of defining the function name and arguments in a structured way. What I am creating is a way of configuring… well let's be specific to my use-case. I am building a way to configure TensorFlow. One which is very

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Marco Sulla
Try to save it in a binary field on PG using hdf5: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_hdf.html On Thu, 22 Oct 2020 at 11:29, Shaozhong SHI wrote: > I found this last option is very interesting. > > Saving the dataframe to memory using StringIO > > htt

Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Shaozhong SHI
I found this last option is very interesting. Saving the dataframe to memory using StringIO https://naysan.ca/2020/06/21/pandas-to-postgresql-using-psycopg2-copy_from/ But, testing shows unicode argument expected, got 'str' Any working example for getting DataFrame into a PostgreSQL table direc