On 20Mar2020 00:37, duncan smith wrote:
On 19/03/2020 20:40, MRAB wrote:
On 2020-03-19 20:08, duncan smith wrote:
I have generator code along the following lines,
Q = queue.Queue()
Q.put(x)
while not Q.empty():
x = Q.get()
if :
yield x
else:
Q.put()
If I
On 19/03/2020 20:40, MRAB wrote:
> On 2020-03-19 20:08, duncan smith wrote:
>> Hello,
>> I have generator code along the following lines,
>>
>>
>> Q = queue.Queue()
>> Q.put(x)
>> while not Q.empty():
>> x = Q.get()
>> if :
>> yield x
>> else:
>> Q.put()
>>
>>
On 11/03/20 7:02 am, Adam Preble wrote:
Is this foo attribute being looked up in an override of __getattr__,
__getattribute__, or is it a reserved slot that's internally doing this? That's
what I'm trying to figure out.
Looking at the source in Objects/typeobject.c, it uses the
tp_getattro ty
On 2020-03-19 20:08, duncan smith wrote:
Hello,
I have generator code along the following lines,
Q = queue.Queue()
Q.put(x)
while not Q.empty():
x = Q.get()
if :
yield x
else:
Q.put()
If I change it to,
Q = []
Q.append(x)
for x in Q:
if :
Hello,
I have generator code along the following lines,
Q = queue.Queue()
Q.put(x)
while not Q.empty():
x = Q.get()
if :
yield x
else:
Q.put()
If I change it to,
Q = []
Q.append(x)
for x in Q:
if :
yield x
else:
Q.append()
then it runs a
On Thu, 19 Mar 2020 at 16:46, Peter J. Holzer wrote:
> This is similar to algebraic expressions: Have you ever tried to read a
> mathematical paper from before the time the current notation (which we
> Long, convoluted
> sentences instead of what can now be written as a short formula.
...yes, and
On 2020-03-19 15:17, Musbur wrote:
Hello,
either it's me or everybody else who's missing the point. I understand
the OP's proposal like this:
dict[set] == {k: dict[k] for k in set}
list[iterable] == [list[i] for i in iterable]
Am I right?
"Iterable" is too broad because it includes tuples an
On 19/03/2020 14:47, Peter J. Holzer wrote:
On 2020-03-19 14:24:35 +, Rhodri James wrote:
On 19/03/2020 13:00, Peter J. Holzer wrote:
It's more compact, especially, if "d" isn't a one-character variable,
but an expression:
fname, lname = db[people].employee.object.get(pk=1234)[['firs
On Fri, Mar 20, 2020 at 2:46 AM Peter J. Holzer wrote:
> > A good language has a small core and extensibility via
> > libraries.
>
> This would actually be a feature of the (standard) library.
I think the line kinda blurs here. This would be a feature of a core
data type, and in CPython, it would
For dictionaries it'd even be more useful:
d = {
'first_name': 'Frances',
'last_name': 'Allen',
'email': 'fal...@ibm.com'
}
fname, lname = d[['first_name', 'last_name']]
Why not do this?
import operator
first_last = operator.itemgetter("first_name", "last_name"
On Fri, Mar 20, 2020 at 2:37 AM Terry Reedy wrote:
>
> On 3/18/2020 10:28 PM, Santiago Basulto wrote:
>
> > For dictionaries it'd even be more useful:
> > d = {
> > 'first_name': 'Frances',
> > 'last_name': 'Allen',
> > 'email': 'fal...@ibm.com'
> > }
> >
On 2020-03-19 08:05:18 -0700, Dan Stromberg wrote:
> On Thu, Mar 19, 2020 at 7:47 AM Peter J. Holzer wrote:
> > On 2020-03-19 14:24:35 +, Rhodri James wrote:
> > > On 19/03/2020 13:00, Peter J. Holzer wrote:
> > > > It's more compact, especially, if "d" isn't a one-character variable,
> > > >
On 03/19/2020 02:09 AM, Terry Reedy wrote:
On 3/18/2020 10:28 PM, Santiago Basulto wrote:
For dictionaries it'd even be more useful:
d = {
'first_name': 'Frances',
'last_name': 'Allen',
'email': 'fal...@ibm.com'
}
fname, lname = d[['first_name', 'last_n
On 3/18/2020 10:28 PM, Santiago Basulto wrote:
For dictionaries it'd even be more useful:
d = {
'first_name': 'Frances',
'last_name': 'Allen',
'email': 'fal...@ibm.com'
}
fname, lname = d[['first_name', 'last_name']]
Insert ordered dicts make this sort
Hello,
either it's me or everybody else who's missing the point. I understand
the OP's proposal like this:
dict[set] == {k: dict[k] for k in set}
list[iterable] == [list[i] for i in iterable]
Am I right?
--
https://mail.python.org/mailman/listinfo/python-list
Santiago Basulto writes:
> Hello community. I have an idea to share with the list to see what you all
> think about it.
>
> I happen to use both Python for Data Science (with our regular friends
> NumPy and Pandas) as well as for scripting and backend development. Every
> time I'm working in serv
On Thu, Mar 19, 2020 at 7:47 AM Peter J. Holzer wrote:
> On 2020-03-19 14:24:35 +, Rhodri James wrote:
> > On 19/03/2020 13:00, Peter J. Holzer wrote:
> > > It's more compact, especially, if "d" isn't a one-character variable,
> > > but an expression:
> > >
> > > fname, lname =
> db[peop
Ooo thanks I understood.
On Thu, 19 Mar, 2020, 8:10 pm Pieter van Oostrum,
wrote:
> Souvik Dutta writes:
>
> > I should have been more clear
> > class first():
> > print("from first")
> > def second():
> > print("from second")
> > first()
> >
> > When I run the above code the ou
On 2020-03-19 14:24:35 +, Rhodri James wrote:
> On 19/03/2020 13:00, Peter J. Holzer wrote:
> > It's more compact, especially, if "d" isn't a one-character variable,
> > but an expression:
> >
> > fname, lname = db[people].employee.object.get(pk=1234)[['first_name',
> > 'last_name']]
> >
Souvik Dutta writes:
> I should have been more clear
> class first():
> print("from first")
> def second():
> print("from second")
> first()
>
> When I run the above code the output is
> "from first"
And where do you think this comes from? Are you thinking this comes from
the cal
On 19/03/2020 13:58, Souvik Dutta wrote:
I should have been more clear
class first():
print("from first")
def second():
print("from second")
first()
When I run the above code the output is
"from first"
(2ND CODE)
class first():
print("from first")
def second():
On Fri, Mar 20, 2020 at 1:04 AM Souvik Dutta wrote:
>
> I should have been more clear
> class first():
> print("from first")
> def second():
> print("from second")
> first()
>
> When I run the above code the output is
> "from first"
> (2ND CODE)
>
Try this *without* the call to fi
On 19/03/2020 13:00, Peter J. Holzer wrote:
On 2020-03-19 18:22:34 +1300, DL Neil via Python-list wrote:
On 19/03/20 3:28 PM, Santiago Basulto wrote:
myself missing A LOT features from NumPy, like fancy indexing or
boolean arrays.
So, has it ever been considered to bake into Python's builtin li
I should have been more clear
class first():
print("from first")
def second():
print("from second")
first()
When I run the above code the output is
"from first"
(2ND CODE)
class first():
print("from first")
def second():
print("from second")
first.second()
When I
If someone from Germany wants to help creatively against the Virus in a
Hackathon this Weekend:
https://www.bundesregierung.de/breg-de/themen/coronavirus/wir-vs-virus-1731968
Am Mo., 16. März 2020 um 21:16 Uhr schrieb Barry Scott <
ba...@barrys-emacs.org>:
>
>
> > On 16 Mar 2020, at 17:38, Orges
On 2020-03-19 18:22:34 +1300, DL Neil via Python-list wrote:
> On 19/03/20 3:28 PM, Santiago Basulto wrote:
> > myself missing A LOT features from NumPy, like fancy indexing or
> > boolean arrays.
> > So, has it ever been considered to bake into Python's builtin list and
> > dictionary types functi
Chris Angelico writes:
> Creating the class runs all the code in the class block, including
> function definitions, assignments, and in this case, a print call.
>
> Classes are not declarations. They are executable code.
Demo:
In [26]: class first():
... print("From first")
...
27 matches
Mail list logo