Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-12 Thread Thomas Passin
All right, now let's verify that tk is not there (otherwise it might be there but corrupted or not loadable for some reason). Open Windows Explorer and navigate it to the Python directory as I described in my last message. The navigate to the subdirectory named "DLLs". If tkinter is installed

Re: Need max values in list of tuples, based on position

2022-11-12 Thread Weatherby,Gerard
Types are available if you want to use them. https://www.pythontutorial.net/python-basics/python-type-hints/ From: Python-list on behalf of Pancho via Python-list Date: Friday, November 11, 2022 at 6:28 PM To: python-list@python.org Subject: Re: Need max values in list of tuples, based on pos

Re: Argument name should be lowercase

2022-11-12 Thread Weatherby,Gerard
RUN is a global constant, and the method is documented, explaining why the parameter is there: # Copy globals as function locals to make sure that they are available # during Python shutdown when the Pool is destroyed. def __del__(self, _warn=warnings.warn, RUN=RUN): From: Python-lis

Re: Need max values in list of tuples, based on position

2022-11-12 Thread 2QdxY4RzWzUUiLuE
On 2022-11-12 at 15:03:10 +, "Weatherby,Gerard" wrote: > Types are available if you want to use > them. https://www.pythontutorial.net/python-basics/python-type-hints/ Python has always been a strongly typed language. Recent changes have given it some level of static type checking in additi

Re: Dealing with non-callable classmethod objects

2022-11-12 Thread Ian Pilcher
On 11/11/22 16:47, Cameron Simpson wrote: On 11Nov2022 15:29, Ian Pilcher wrote: * Can I improve the 'if callable(factory):' test above?  This treats  all non-callable objects as classmethods, which is obviously not  correct.  Ideally, I would check specifically for a classmethod, but  there do

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-12 Thread Thomas Passin
On 11/12/2022 11:48 AM, darkst...@o2online.de wrote: Hello Thomas, there is a “_tkinter.pyd” in the *.dll Directory. Is there something more, I can check? Yes, look in the "Lib" (NOT "libs") subdirectory of the Python tree and see if it has a subdirectory named "tkinter". That's where it is

Re: Persisting functions typed into the shell

2022-11-12 Thread Wayne Harris via Python-list
On 12/11/2022 10:01, Stefan Ram wrote: > Many readers here know interactive Python sessions with > prompts like ">>>". But a "session" could be something else. > One could imagine that when starting a new session, one > still sees all the variables and constants defined in > preceding s

Re: Need max values in list of tuples, based on position

2022-11-12 Thread Dennis Lee Bieber
On Fri, 11 Nov 2022 21:20:10 -0500, DFS declaimed the following: >Yeah, I don't know why cursor.description doesn't work with SQLite; all >their columns are basically varchars. > If you read PEP 249 (the general DB-API), everything except column name and data type code are optional. And

Re: Persisting functions typed into the shell

2022-11-12 Thread dn
On 13/11/2022 05.05, Stefan Ram wrote: Wayne Harris writes: Wow. Could the dis module help at all? Thank you for this idea! I think this should work, but only under CPython and not necessarily across different Python versions. Still, I might use dis. Was constructing a two-part tu

Re: Dealing with non-callable classmethod objects

2022-11-12 Thread Weatherby,Gerard
Use the inspect module as Cameron suggested. import inspect def analyze_class(clzz): """Analyze a class proof of concept""" assert inspect.isclass(clzz) for k, v in inspect.getmembers(clzz, lambda v: inspect.isfunction(v) or inspect.ismethod(v)): if inspect.ismethod(v):

Re: Persisting functions typed into the shell

2022-11-12 Thread Weatherby,Gerard
Sounds like Jupyter Notebooks: https://jupyter.org From: Python-list on behalf of Stefan Ram Date: Saturday, November 12, 2022 at 1:48 PM To: python-list@python.org Subject: Persisting functions typed into the shell *** Attention: This is an external email. Use caution responding, opening at

Re: Need max values in list of tuples, based on position

2022-11-12 Thread Dennis Lee Bieber
On Sat, 12 Nov 2022 13:24:37 -0500, Dennis Lee Bieber declaimed the following: > Granted, this will NOT work with "select *" unless one does the select >*/fetchall first, AND extracts the names from the cursor description -- >then run a loop to create the select max(length(col)), ... state

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-12 Thread Eryk Sun
On 11/12/22, darkst...@o2online.de wrote: > import _tkinter > Traceback (most recent call last): > File "", line 1, in > ImportError: DLL load failed while importing _tkinter: Das angegebene Modul > wurd > e nicht gefunden. Loading the extension module "_tkinter.pyd" tries to load two TCL

Re: Dealing with non-callable classmethod objects

2022-11-12 Thread Cameron Simpson
On 12Nov2022 18:44, Weatherby,Gerard wrote: Use the inspect module as Cameron suggested. My suggestions was not for the post-construction class attributes but for the comtents of the "_attrs" mapping. Post construction the class method is callable. But the classmethod object stashed in "_att

Re: Dealing with non-callable classmethod objects

2022-11-12 Thread Cameron Simpson
On 12Nov2022 10:34, Ian Pilcher wrote: So I've done this. class _HasUnboundClassMethod(object): @classmethod def _classmethod(cls): pass # pragma: no cover _methods = [ _classmethod ] _ClassMethodType = type(_HasUnboundClassMethod._methods[0]) Which allo

Re: Persisting functions typed into the shell

2022-11-12 Thread Chris Angelico
On Sun, 13 Nov 2022 at 05:48, Stefan Ram wrote: > So much for the topic of "In Python, /everything/ is an > object"! There seem to be first and second-class objects: > Shelveable and non-shelveable objects. > That's a bit unfair. Everything IS an object, but not all objects can be treated t

Re: Dealing with non-callable classmethod objects

2022-11-12 Thread Ian Pilcher
On 11/12/22 14:57, Cameron Simpson wrote: You shouldn't need a throwaway class, just use the name "classmethod" directly - it's the type!     if not callable(factory):     if type(factory) is classmethod:     # replace fctory with a function calling factory.__func__    

Re: Dealing with non-callable classmethod objects

2022-11-12 Thread Cameron Simpson
On 13Nov2022 07:57, Cameron Simpson wrote: # replace fctory with a function calling factory.__func__ factory = lambda arg: factory.__func__(classmethod, arg) It just occurred to me that you might need to grab the value of factory.__func__ first: factory0 = factory

Re: Dealing with non-callable classmethod objects

2022-11-12 Thread Cameron Simpson
On 13Nov2022 10:08, Cameron Simpson wrote: On 13Nov2022 07:57, Cameron Simpson wrote: # replace fctory with a function calling factory.__func__ factory = lambda arg: factory.__func__(classmethod, arg) It just occurred to me that you might need to grab the value of factor