Ian Pilcher wrote at 2022-11-11 15:29 -0600:
> ...
>In searching, I've found a few articles that discuss the fact that
>classmethod objects aren't callable, but the situation actually seems to
>be more complicated.
>
> >>> type(DuidLLT._parse_l2addr)
>
> >>> callable(DuidLLT._parse_l2addr)
>True
>
On Sat, Nov 12, 2022 at 11:53 AM Inada Naoki wrote:
>
> On Sat, Nov 12, 2022 at 10:21 AM 12Jessicasmith34
> <12jessicasmit...@gmail.com> wrote:
> >
> >
> > Two questions: any idea why this would be happening in this situation?
> > AFAIK, stdout *is* a console when these images are running the pyt
On Sat, Nov 12, 2022 at 10:21 AM 12Jessicasmith34
<12jessicasmit...@gmail.com> wrote:
>
>
> Two questions: any idea why this would be happening in this situation? AFAIK,
> stdout *is* a console when these images are running the python process.
> Second - is there a way I can check the locale and
On 11/11/2022 7:04 PM, Dennis Lee Bieber wrote:
On Fri, 11 Nov 2022 15:03:49 -0500, DFS declaimed the
following:
Thanks for looking at it. I'm trying to determine the maximum length of
each column result in a SQL query. Normally you can use the 3rd value
of the cursor.description object (se
On 11/11/22, 12Jessicasmith34 <12jessicasmit...@gmail.com> wrote:
>
> any idea why this would be happening in this situation? AFAIK, stdout
> *is* a console when these images are running the python process.
If sys.std* are console files, then in Python 3.6+,
sys.std*.buffer.raw will be _io._Window
> If stdout isn't a console (e.g. a pipe), it defaults to using the
process code page (i.e. CP_ACP), such as legacy code page 1252
(extended Latin-1).
First off, really helpful information, thank you. That was the exact background
I was missing.
Two questions: any idea why this
On 11/11/22, ohins...@gmail.com wrote:
>
> I am real a beginner of Python. Not able to create a Python launcher
> (shortcut) on Desktop after the installation.
Did you already install Python? If not, open the Store, and install
the Python 3.11 app that's published by the Python Software
Foundati
On 11/11/2022 5:07 PM, Ian Pilcher wrote:
On 11/11/22 11:02, Thomas Passin wrote:
You can define a classmethod in SubClass that seems to do the job:
class SuperClass(object):
@staticmethod
def spam(): # "spam" and "eggs" are a Python tradition
print('spam from SuperCla
On 11/11/2022 4:44 PM, ohins...@gmail.com wrote:
Hello,
I am real a beginner of Python. Not able to create a Python launcher
(shortcut) on Desktop after the installation.
Would you kindly instruct how to do it?
Windows 11-Home, 64 bits, HP desktop
If you get an offer of Python wh
On Fri, 11 Nov 2022 15:03:49 -0500, DFS declaimed the
following:
>Thanks for looking at it. I'm trying to determine the maximum length of
>each column result in a SQL query. Normally you can use the 3rd value
>of the cursor.description object (see the DB-API spec), but apparently
>not with
On 11/10/22, Jessica Smith <12jessicasmit...@gmail.com> wrote:
>
> Weird issue I've found on Windows images in Azure Devops Pipelines and
> Github actions. Printing Unicode characters fails on these images because,
> for some reason, the encoding is mapped to cp1252. What is particularly
> weird ab
On 11/11/2022 20:58, Thomas Passin wrote:
On 11/11/2022 2:22 PM, Pancho via Python-list wrote:
On 11/11/2022 18:53, DFS wrote:
On 11/11/2022 12:49 PM, Dennis Lee Bieber wrote:
On Fri, 11 Nov 2022 02:22:34 -0500, DFS declaimed the
following:
[(0,11), (1,1), (2,1),
(0,1) , (1,41), (2,2),
On 11/11/2022 2:22 PM, Pancho wrote:
On 11/11/2022 18:53, DFS wrote:
On 11/11/2022 12:49 PM, Dennis Lee Bieber wrote:
On Fri, 11 Nov 2022 02:22:34 -0500, DFS declaimed the
following:
[(0,11), (1,1), (2,1),
(0,1) , (1,41), (2,2),
(0,9) , (1,3), (2,12)]
The set of values in elements[0]
Hello,
I am real a beginner of Python. Not able to create a Python launcher
(shortcut) on Desktop after the installation.
Would you kindly instruct how to do it?
Windows 11-Home, 64 bits, HP desktop
Thanks,
Dan
--
https://mail.python.org/mailman/listinfo/python-list
On 11/11/2022 2:22 AM, DFS wrote:
[(0,11), (1,1), (2,1),
(0,1) , (1,41), (2,2),
(0,9) , (1,3), (2,12)]
The set of values in elements[0] is {0,1,2}
I want the set of max values in elements[1]: {11,41,12}
This request is ambiguous. Do you want to get the maximum value for
each row, and
On 11Nov2022 15:29, Ian Pilcher wrote:
I am trying to figure out a way to gracefully deal with uncallable
classmethod objects.
I'm just going to trim your example below a bit for reference purposes:
class DUID(object):
def __init__(self, d):
for attr, factory in self._attrs.items()
On 12Nov2022 09:17, Cameron Simpson wrote:
On 11Nov2022 10:21, Ian Pilcher wrote:
class SubClass(SuperClass):
bar = SuperClass.foo
^^
Is there a way to do this without specifically naming 'SuperClass'?
I think not.
Then I saw your "Dealing with non-callable classmeth
On 11/11/22, darkst...@o2online.de wrote:
>
> What can I do for the next step to find, why IDLE isn’t working?
The question is why tkinter isn't working. IDLE not working is just a
symptom of the underlying problem. In the command prompt, run 32-bit
Python 3.10 via `py -3.10-32`. In Python's inte
On 11Nov2022 10:21, Ian Pilcher wrote:
Is it possible to access the name of a superclass static method, when
defining a subclass attribute, without specifically naming the super-
class?
Contrived example:
class SuperClass(object):
@staticmethod
def foo():
pass
class SubCl
On 11/11/22 11:02, Thomas Passin wrote:
You can define a classmethod in SubClass that seems to do the job:
class SuperClass(object):
@staticmethod
def spam(): # "spam" and "eggs" are a Python tradition
print('spam from SuperClass')
class SubClass(SuperClass):
@cla
Thanks for the thoughts!
On 11/11/2022 21.54, dn wrote:
PyCharm is warning against using an identifier of all upper-case letters
as a function's parameter, saying "Argument name should be lowercase".
(weak, code smell)
...
PEP-008: makes no mention, and is but a guide anyway.
(that said, if
On 11/11/22 11:29, Dieter Maurer wrote:
Ian Pilcher wrote at 2022-11-11 10:21 -0600:
class SuperClass(object):
@staticmethod
def foo():
pass
class SubClass(SuperClass):
bar = SuperClass.foo
^^
Is there a way to do this without specifi
On 11/11/2022 2:22 PM, Pancho via Python-list wrote:
On 11/11/2022 18:53, DFS wrote:
On 11/11/2022 12:49 PM, Dennis Lee Bieber wrote:
On Fri, 11 Nov 2022 02:22:34 -0500, DFS declaimed the
following:
[(0,11), (1,1), (2,1),
(0,1) , (1,41), (2,2),
(0,9) , (1,3), (2,12)]
The set of value
I am trying to figure out a way to gracefully deal with uncallable
classmethod objects. The class hierarchy below illustrates the issue.
(Unfortunately, I haven't been able to come up with a shorter example.)
import datetime
class DUID(object):
_subclasses = {}
def __init_subclass__
On Sat, 12 Nov 2022 at 06:42, Stefan Ram wrote:
>
> "Weatherby,Gerard" writes:
> >I'd personally find it weird to see an all-cap parameter
>
> In the source code of the standard library, all-caps
> notation is used for a parameter name sometimes
> if that parameter name is "URL" or sometime
On 11/11/2022 7:50 AM, Stefan Ram wrote:
Pancho writes:
def build_max_dict( tups):
dict = {}
for (a,b) in tups:
if (a in dict):
if (b>dict[a]):
dict[a]=b
else:
dict[a]=b
return(sorted(dict.values()))
Or,
import it
On Fri, 11 Nov 2022 02:22:34 -0500, DFS declaimed the
following:
>
>[(0,11), (1,1), (2,1),
> (0,1) , (1,41), (2,2),
> (0,9) , (1,3), (2,12)]
>
>The set of values in elements[0] is {0,1,2}
>
>I want the set of max values in elements[1]: {11,41,12}
Do they have to be IN THAT OR
On 11/11/2022 07:22, DFS wrote:
[(0,11), (1,1), (2,1),
(0,1) , (1,41), (2,2),
(0,9) , (1,3), (2,12)]
The set of values in elements[0] is {0,1,2}
I want the set of max values in elements[1]: {11,41,12}
def build_max_dict( tups):
dict = {}
for (a,b) in tups:
if (a in di
On 11/11/2022 18:53, DFS wrote:
On 11/11/2022 12:49 PM, Dennis Lee Bieber wrote:
On Fri, 11 Nov 2022 02:22:34 -0500, DFS declaimed the
following:
[(0,11), (1,1), (2,1),
(0,1) , (1,41), (2,2),
(0,9) , (1,3), (2,12)]
The set of values in elements[0] is {0,1,2}
I want the set of max val
[(0,11), (1,1), (2,1),
(0,1) , (1,41), (2,2),
(0,9) , (1,3), (2,12)]
The set of values in elements[0] is {0,1,2}
I want the set of max values in elements[1]: {11,41,12}
--
https://mail.python.org/mailman/listinfo/python-list
On 11/11/2022 12:49 PM, Dennis Lee Bieber wrote:
On Fri, 11 Nov 2022 02:22:34 -0500, DFS declaimed the
following:
[(0,11), (1,1), (2,1),
(0,1) , (1,41), (2,2),
(0,9) , (1,3), (2,12)]
The set of values in elements[0] is {0,1,2}
I want the set of max values in elements[1]: {11,41,12}
On Tuesday, 8 November 2022 at 05:36:49 UTC+5:30, David wrote:
> On Tue, 8 Nov 2022 at 03:08, ICT Ezy wrote:
>
> > Please explain how to generate different output in following logical
> > operations
>
> > >>> 0 and True
> > 0
> > >>> 0 or True
> > True
> > >>> 1 and True
> > True
> > >>
Hello,
Weird issue I've found on Windows images in Azure Devops Pipelines and
Github actions. Printing Unicode characters fails on these images because,
for some reason, the encoding is mapped to cp1252. What is particularly
weird about the code page being set to 1252 is that if you execute "chcp"
Ian Pilcher wrote at 2022-11-11 10:21 -0600:
>Is it possible to access the name of a superclass static method, when
>defining a subclass attribute, without specifically naming the super-
>class?
>
>Contrived example:
>
> class SuperClass(object):
> @staticmethod
> def foo():
>
You can define a classmethod in SubClass that seems to do the job:
class SuperClass(object):
@staticmethod
def spam(): # "spam" and "eggs" are a Python tradition
print('spam from SuperClass')
class SubClass(SuperClass):
@classmethod
def eggs(self):
super().
yes,
just use SubClass.foo
at least this works for me:
class SuperClass:
@staticmethod
def test():
print("yay")
class SubClass(SuperClass):
def __init__(self):
super().__init__()
SubClass.test()
subclass = SubClass()
Output:
python3.11 test.py
yay
If you wanted to document/enforce the input argument is immutable, you could do
one of the following. You’d get a type warning in PyCharm with bad_func or
equivalent, and bad_func2 will fail at runtime.
def bad_func(x: typing.Mapping):
"""Get type warning if x modified"""
x[3] = 7
def
Is it possible to access the name of a superclass static method, when
defining a subclass attribute, without specifically naming the super-
class?
Contrived example:
class SuperClass(object):
@staticmethod
def foo():
pass
class SubClass(SuperClass):
bar = SuperCl
On 2022-11-11 08:54, dn wrote:
[snip]
The module's function definition is:
def build_product_prices_dictionary( WORKBOOK_DEFINITIONS:dict )->dict:
...
price_array = xl.iget_array(
file_name=WORKBOOK_DEFINITIONS[ "file_name" ],
...
(the function def is flagged, as abov
This is a matter of convention. Historically, many language
practitioners got used to using all-caps for key constants. This makes
it easier to tell when you are using (or misusing) one, for one thing.
For myself, I also will use all-caps for quasi-constants, ones that are
set only once, for
PEP 8 doesn’t explicitly list a naming convention for function parameters, but
every example shows them as lowercase, even though the function doesn’t modify
them.
See also the Python tutorial (
https://docs.python.org/3/tutorial/controlflow.html#defining-functions ), which
also shows all para
PyCharm is warning against using an identifier of all upper-case letters
as a function's parameter, saying "Argument name should be lowercase".
(weak, code smell)
The application consists of three+ files:
- configuration
- mainline script
- module of workbook functions
The mainline reads the
42 matches
Mail list logo