Python Forum
Compiler fault or some kind of weird referencing bug?
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compiler fault or some kind of weird referencing bug?
#11
(May-09-2017, 08:32 PM)volcano63 Wrote: return a new encoded list - instead of changing the argument list in place (which is side-effect - considered bad practice?! )
Yes, side-effects are generally-speaking not ideal, and don't gain anything here (sometimes modifying in-place is more efficient, but copies are being made here anyway).
Reply
#12
(May-08-2017, 12:07 AM)Joseph_f2 Wrote:
for x in range(0, 16):     data.append(x)
I was planning to point it out - but got distracted. Those 2 lines are absolutely redundant
data = list(range(16))
does the trick. (One of the few things from Scala/Java I personally miss in Python - toList method  Huh )
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Python compiler NeoQuant 1 481 Nov-30-2025, 09:50 AM
Last Post: noisefloor
  fast compiler Frankduc 4 3,290 Aug-25-2025, 12:29 PM
Last Post: Frankduc
  [pyparsing] How to make my simple parser fault tolerant medihack 0 1,343 May-14-2024, 04:52 PM
Last Post: medihack
  When does Python need to use a compiler? JanOlvegg 5 8,093 Mar-09-2023, 04:24 PM
Last Post: snippsat
  What kind of list is this? jesse68 2 2,328 Jun-29-2022, 05:02 PM
Last Post: rob101
  make: *** [Makefile:29: all] Segmentation fault Anldra12 2 3,567 May-01-2022, 06:17 PM
Last Post: Anldra12
  name 'lblstatus' is not defined when referencing a label KatManDEW 4 3,613 Apr-21-2022, 12:33 PM
Last Post: KatManDEW
  Dictionary Referencing nickdavis2017 1 2,655 Nov-20-2021, 06:24 PM
Last Post: deanhystad
  Referencing string names in df to outside variables illmattic 1 2,281 Nov-16-2021, 12:47 PM
Last Post: jefsummers
  Segmentation fault (core dumped) hobbyist 1 17,341 Jun-07-2021, 12:56 PM
Last Post: supuflounder

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020
This forum uses Lukasz Tkacz MyBB addons.
Forum use Krzysztof "Supryk" Supryczynski addons.