On Fri, 25 May 2018 02:45:38 +, Paul wrote:
> how often would people here have needed this new operator, if it had
> existed?
It is common enough that it is a FAQ on the Python website.
The list * operator isn't the most heavily used operator, but it does get
used a bit. It comes up quite f
On Fri, 25 May 2018 15:30:36 +1000, Cameron Simpson wrote:
> So, how to various forms of multidimensional lists play out as code?
With my suggestion, we get:
x = [0]**3 # one-dimensional
y = [[0]**3]**3 # two-dimensional
z = [[[0]**3]**3]**3 # three-dimensional
Or there's MRAB's suggestion o
On Fri, 25 May 2018 08:11:52 +0200, Stefan Behnel wrote:
> Steven D'Aprano schrieb am 25.05.2018 um 04:25:
[...]
>> You might be right: on further thought, I think I want deep copies, not
>> shallow.
>
> But how would that protocol work then? What would happen with a data
> structure like this:
Steven D'Aprano schrieb am 25.05.2018 um 04:25:
> On Thu, 24 May 2018 15:12:09 -0400, Ned Batchelder wrote:
>
>> On 5/24/18 2:17 PM, Steven D'Aprano wrote:
> [...]
>>> But what do people think about proposing a new list replication with
>>> copy operator?
>>>
>>> [[]]**5
>>>
>>> would return
bruceg113...@gmail.com writes:
> I am trying to convert a string to a variable.
>
> I got cases 1 & 2 to work, but not cases 3 & 4.
>
> The print statement in cases 3 & 4 reports the following:
> builtins.AttributeError: type object 'animal' has no attribute 'tiger'
>
> I am stuck on crea
On 25May2018 02:32, Steven D'Aprano
wrote:
On Fri, 25 May 2018 08:02:38 +1000, Cameron Simpson wrote:
I'm also against the "**" spelling I find, for much the same reasons
that people oppose allowing "=" and "==" in the same syntactic location:
they're easy to get wrong through typing inaccura
On 25May2018 02:25, Steven D'Aprano
wrote:
On Thu, 24 May 2018 15:12:09 -0400, Ned Batchelder wrote:
On 5/24/18 2:17 PM, Steven D'Aprano wrote:
[...]
But what do people think about proposing a new list replication with
copy operator?
[[]]**5
would return a new list consisting of five
Hi.
I've put some thoughts together, and
need some feedback on this proposal.
Main question is: Is it convincing?
Is there any flaw?
My own opinion - there IS something to chase.
Still the justification for such syntax is hard.
Raw string statement
--
Issue
-
Vast majority
how often would people here have needed this new operator, if it had
existed?
--
https://mail.python.org/mailman/listinfo/python-list
On Thursday, May 24, 2018 at 8:51:07 PM UTC-4, asa3...@gmail.com wrote:
> hi just seeing if there is a cleaner way to write this.
>
> s1= "kitti"
> s2= 'kitti'
> i= 3
> print(s1+ "\n" + "="*i + "^" + "\n" +s2)
>
> >
> kitti
> ===^
> kitti
more legible that way... thks
--
https://mail.python.
On Thu, 24 May 2018 16:05:32 -0700, Paul wrote:
> How would one make a multi-dimensional list now, with truly-separate sub
> lists? Is there just no way to do it with the replication operator?
Correct. Let's say you want to make a 1-D list with three items
initialised to zero. This works brilli
On Fri, 25 May 2018 08:02:38 +1000, Cameron Simpson wrote:
> I'm also against the "**" spelling I find, for much the same reasons
> that people oppose allowing "=" and "==" in the same syntactic location:
> they're easy to get wrong through typing inaccuracy.
Do you often write
y = 2**x
when
On Thu, 24 May 2018 19:12:33 -0700, asa32sd23 wrote:
> here is the code, i keep getting an error, "break outside loop". if it
> is false just exit function
break doesn't exit the function, it exits the loop. There is no loop to
exit, so it is an error.
Believe the compiler when it tells you the
On Thu, 24 May 2018 15:12:09 -0400, Ned Batchelder wrote:
> On 5/24/18 2:17 PM, Steven D'Aprano wrote:
[...]
>> But what do people think about proposing a new list replication with
>> copy operator?
>>
>> [[]]**5
>>
>> would return a new list consisting of five shallow copies of the inner
>>
On Thu, May 24, 2018 at 9:12 PM, wrote:
> here is the code, i keep getting an error, "break outside loop". if it is
> false just exit function
>
>
> def d(idx):
> if type(idx) != int:
> break
>
> d('k')
"break" (and "continue") are only meaningful inside for or while
loops. You do
On Thu, 24 May 2018 17:50:53 -0700, asa32sd23 wrote:
> hi just seeing if there is a cleaner way to write this.
>
> s1= "kitti"
> s2= 'kitti'
> i= 3
> print(s1+ "\n" + "="*i + "^" + "\n" +s2)
s = "kitti"
i = 3
print(s, "="*i + "^", s, sep='\n')
--
Steve
--
https://mail.python.org/mailma
here is the code, i keep getting an error, "break outside loop". if it is false
just exit function
def d(idx):
if type(idx) != int:
break
d('k')
--
https://mail.python.org/mailman/listinfo/python-list
On 2018-05-25 01:50, asa32s...@gmail.com wrote:
hi just seeing if there is a cleaner way to write this.
s1= "kitti"
s2= 'kitti'
i= 3
print(s1+ "\n" + "="*i + "^" + "\n" +s2)
kitti
===^
kitti
When printing, I'd probably just go for something clear and simple:
print(s1)
print("=" * i + "
On 05/24/2018 08:20 AM, Grant Edwards wrote:
> But you had to jump through hoops with procmail and server/client side
> filtering to get there.
True, but it takes maybe 30 seconds for each new list I sign up for, and
then it's out of sight, out of mind. I already do a ton of filtering on
my inbox
On 05/24/2018 07:01 AM, Steven D'Aprano wrote:
> On Thu, 24 May 2018 05:44:26 -0600, Michael Torrie wrote:
>
>> I agree web forums really suck for any kind of multi-user conversation.
>
> Oh good. Because the Python core-devs are talking about moving to
> Github's web interface instead of email.
On 05/24/2018 07:10 AM, Chris Green wrote:
> A *thread* yes, but not a whole list. I.e. if you read this using
> mail/IMAP you can mark a thread read but you can't mark *all* Python
> list messages read in one go can you? With tin/Usenet I look at
> the list of new subjects in the Python group
On Thu, 24 May 2018 11:24:41 -0700, Rob Gaddi wrote:
> On 05/24/2018 11:17 AM, Steven D'Aprano wrote:
[...]
>> But what do people think about proposing a new list replication with
>> copy operator?
>>
>> [[]]**5
>>
>> would return a new list consisting of five shallow copies of the inner
>>
On 5/24/2018 11:31 AM, Chester Davies via Python-list wrote:
Hi!
Yesterday I downloaded the latest version of Python, after some fiddling around
with some command line, getting Python to open files etc, it wasn't able to
find various pillows, so after a while, I decided to call it a night. I w
hi just seeing if there is a cleaner way to write this.
s1= "kitti"
s2= 'kitti'
i= 3
print(s1+ "\n" + "="*i + "^" + "\n" +s2)
>
kitti
===^
kitti
--
https://mail.python.org/mailman/listinfo/python-list
On 2018-05-25 00:05, Paul wrote:
How would one make a multi-dimensional list now, with truly-separate sub
lists? Is there just no way to do it with the replication operator? IE,
would I just have to do
X = [[], [], [], [], []]
or perhaps write a function to insert new sub lists into a list,
Paul writes:
> How would one make a multi-dimensional list now, with truly-separate sub
> lists? Is there just no way to do it with the replication operator? IE,
> would I just have to do
> X = [[], [], [], [], []]
The expressions in a comprehension are evaluated each time through. So
this is
How would one make a multi-dimensional list now, with truly-separate sub
lists? Is there just no way to do it with the replication operator? IE,
would I just have to do
X = [[], [], [], [], []]
or perhaps write a function to insert new sub lists into a list, or...?
Thanks
> Paul C.
>
>
--
h
I am trying to convert a string to a variable.
I got cases 1 & 2 to work, but not cases 3 & 4.
The print statement in cases 3 & 4 reports the following:
builtins.AttributeError: type object 'animal' has no attribute 'tiger'
I am stuck on creating variables that can be accessed as follows
On 24May2018 18:17, Steven D'Aprano
wrote:
Python has a sequence replication operator:
py> [1, 2]*3
[1, 2, 1, 2, 1, 2]
Unfortunately, it is prone to a common "gotcha":
py> x = [[]]*5 # make a multi-dimensional list
py> x
[[], [], [], [], []]
py> x[0].append(1)
py> x
[[1], [1], [1], [1], [1]
First up, thank you for a well described problem! Remarks inline below.
On 24May2018 03:13, Subhabrata Banerjee wrote:
I have a text as,
"Hawaii volcano generates toxic gas plume called laze PAHOA: The eruption of Kilauea volcano in Hawaii sparked new
safety warnings about toxic gas on the Bi
On 2018-05-24 20:12, Ned Batchelder wrote:
On 5/24/18 2:17 PM, Steven D'Aprano wrote:
Python has a sequence replication operator:
py> [1, 2]*3
[1, 2, 1, 2, 1, 2]
Unfortunately, it is prone to a common "gotcha":
py> x = [[]]*5 # make a multi-dimensional list
py> x
[[], [], [], [], []]
py> x[
On 5/24/18 2:17 PM, Steven D'Aprano wrote:
Python has a sequence replication operator:
py> [1, 2]*3
[1, 2, 1, 2, 1, 2]
Unfortunately, it is prone to a common "gotcha":
py> x = [[]]*5 # make a multi-dimensional list
py> x
[[], [], [], [], []]
py> x[0].append(1)
py> x
[[1], [1], [1], [1], [1]]
On 05/24/2018 11:17 AM, Steven D'Aprano wrote:
Python has a sequence replication operator:
py> [1, 2]*3
[1, 2, 1, 2, 1, 2]
Unfortunately, it is prone to a common "gotcha":
py> x = [[]]*5 # make a multi-dimensional list
py> x
[[], [], [], [], []]
py> x[0].append(1)
py> x
[[1], [1], [1], [1],
Python has a sequence replication operator:
py> [1, 2]*3
[1, 2, 1, 2, 1, 2]
Unfortunately, it is prone to a common "gotcha":
py> x = [[]]*5 # make a multi-dimensional list
py> x
[[], [], [], [], []]
py> x[0].append(1)
py> x
[[1], [1], [1], [1], [1]]
The reason for this behaviour is that * do
Hi!
Yesterday I downloaded the latest version of Python, after some fiddling around
with some command line, getting Python to open files etc, it wasn't able to
find various pillows, so after a while, I decided to call it a night. I went to
finish it off today, and discovered my computer had up
Hi!
Yesterday I downloaded the latest version of Python, after some fiddling around
with some command line, getting Python to open files etc, it wasn't able to
find various pillows, so after a while, I decided to call it a night. I went to
finish it off today, and discovered my computer had up
José María Mateos wrote:
> On Thu, May 24, 2018, at 09:10, Chris Green wrote:
> > > Yes I can mark an entire thread as "read" in IMAP.
> > >
> > A *thread* yes, but not a whole list. I.e. if you read this using
> > mail/IMAP you can mark a thread read but you can't mark *all* Python
> > list mes
On Thu, May 24, 2018, at 09:10, Chris Green wrote:
> > Yes I can mark an entire thread as "read" in IMAP.
> >
> A *thread* yes, but not a whole list. I.e. if you read this using
> mail/IMAP you can mark a thread read but you can't mark *all* Python
> list messages read in one go can you? With t
On 2018-05-24, Michael Torrie wrote:
> On 05/23/2018 12:03 PM, Grant Edwards wrote:
>> But IMO email pales in comparison to NNTP when there are more than a
>> few messages per day per group.
>
> This is not my experience at all. I used to use Usenet back in the day,
> but for nearly the last two
Michael Torrie wrote:
> Comparing to IMAP and Thunderbird:
>
> On 05/23/2018 04:39 PM, Chris Green wrote:
> > Well from other comments here it seems I'm not alone but anyway:-
> >
> > Proper threading etc. is built in
>
> check.
>
> >
> > It's automatically archived and one can search
On Thu, 24 May 2018 05:44:26 -0600, Michael Torrie wrote:
> I agree web forums really suck for any kind of multi-user conversation.
Oh good. Because the Python core-devs are talking about moving to
Github's web interface instead of email. Because Github is the future :-)
https://circleci.com/bl
Comparing to IMAP and Thunderbird:
On 05/23/2018 04:39 PM, Chris Green wrote:
> Well from other comments here it seems I'm not alone but anyway:-
>
> Proper threading etc. is built in
check.
>
> It's automatically archived and one can search back through
> threads for old postings,
On 05/23/2018 12:03 PM, Grant Edwards wrote:
> Yes. NNTP and NNTP clients were designed from the ground up to deal
> with ongoing discussions shared by large groups of people posting lots
> of messages, and they're _very_ good at.
>
> Email was designed for one person sending one message to anoth
I have a text as,
"Hawaii volcano generates toxic gas plume called laze PAHOA: The eruption of
Kilauea volcano in Hawaii sparked new safety warnings about toxic gas on the
Big Island's southern coastline after lava began flowing into the ocean and
setting off a chemical reaction. Lava haze is
On 24/05/2018 03:37, Terry Reedy wrote:
On 5/23/2018 8:46 PM, bartc wrote:
On 24/05/2018 00:44, Terry Reedy wrote:
On 5/23/2018 5:56 PM, Rob Gaddi wrote:
On 05/23/2018 02:51 PM, asa32s...@gmail.com wrote:
s = "kitti"
0,1,2,3,4
k,i,t,t,i
how do i retrieve '4'. i know i can do a len(s)-1,
U
Ned Batchelder wrote:
On 5/23/18 12:03 PM, Gene Heskett wrote:
Brain damaged by facebook, AOL, M$, Google, yahoo yadda yadda into
thinking that webmail and forums are the only game in town?
Please avoid accusing others of being brain damaged, even if it was
meant in a humorous context. :(
I
46 matches
Mail list logo