David DB Baumgold Looping Like a Pro in Python PyCon 2017

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ธ.ค. 2024

ความคิดเห็น • 25

  • @map-creator
    @map-creator 7 ปีที่แล้ว +43

    Start from 16:37 if you know the basics.

    • @arjunkirpal9776
      @arjunkirpal9776 7 ปีที่แล้ว +1

      Yes, a very clear explanation of the basics till then

    • @DaLoler1
      @DaLoler1 5 ปีที่แล้ว +2

      Thank you

    • @RoamingAdhocrat
      @RoamingAdhocrat 4 ปีที่แล้ว +1

      I was five minutes in, thinking "who goes to PyCon and doesn't know this stuff"

  • @DeepSukhwani
    @DeepSukhwani 4 ปีที่แล้ว +1

    15:20 - best explanation of `zip` function I have seen in a while 🙌🏼

  • @fordimension
    @fordimension 7 ปีที่แล้ว +9

    Good talk to recommend to those who are new to Python, thank you. Never heard of that trick to put logic in a generator function to separate it from the loop.

  • @ColinDavidChen
    @ColinDavidChen 7 ปีที่แล้ว +23

    Volume is a bit low :(

  • @timothylombard1727
    @timothylombard1727 7 ปีที่แล้ว

    thank you DB! This talk inspired me to write my first generator to track down the "next" links in the FaceBook API response. Way better than what I had before- yahoo!

  • @TheNosterx
    @TheNosterx 7 ปีที่แล้ว +11

    Really good talk to introduce looping in python to beginners, except he didn't mention "for/else" and "while/else" constructions. For "Pro" talk I expect something about functools, itertools, enum modules or any other nice python looping feature you don't read about on firtst page of any "python for beginners" book.

    • @TheNosterx
      @TheNosterx 7 ปีที่แล้ว

      not missed - I was going to write "more" instead of "something". idk what is wrong with me =) Thank you for pointing on this mistake.

  • @martinangelov1306
    @martinangelov1306 7 ปีที่แล้ว +3

    Volume of almost all talks of the conference is very low. :(

  • @webapplicationguide3798
    @webapplicationguide3798 7 ปีที่แล้ว

    Thank You !!..
    I live the way, you differentiate the C Syntax and Python..
    One more point, I can take away from this talk is dealing with nested loops using generators. especially, return statement which might help me lot.

  • @hyunwoolee6594
    @hyunwoolee6594 4 ปีที่แล้ว

    Thanks so much. This is really helpful.

  • @stanisgmi
    @stanisgmi 7 ปีที่แล้ว +6

    First half was really basic, you can skip it if you know what [while, for, break, continue, zip, range, reversed and sort] are.

  • @samson4504
    @samson4504 5 ปีที่แล้ว

    Loved it great talk!

  • @seanspicer516
    @seanspicer516 6 ปีที่แล้ว +1

    according to rudy giuliani "truth != truth" so....

  • @arjunkirpal9776
    @arjunkirpal9776 7 ปีที่แล้ว +1

    Clear

  • @anshumandhuliya
    @anshumandhuliya 7 ปีที่แล้ว +4

    didn't know that they teach abcd... in PYCON too !!

  • @brotherlui5956
    @brotherlui5956 6 ปีที่แล้ว

    At 19:55 it's 100,000x faster not 10,000

  • @user-mb3mf2og9k
    @user-mb3mf2og9k 6 ปีที่แล้ว +1

    Why not invent a new keyword called 'breakall'?

    • @cristian-bull
      @cristian-bull 6 ปีที่แล้ว +1

      They rejected several proposals for solving this situation: www.python.org/dev/peps/pep-3136/#keyword
      In my opinion, so far the best (but really ugly) solution, is using raise and except:
      try:
      for i in range(100):
      for j in range(1000):
      for k in range(10000):
      if i + j + k == 777:
      raise Found
      except Found:
      print i, j, k

    • @cristian-bull
      @cristian-bull 6 ปีที่แล้ว +1

      breakall would probably be a problem with main loops and gui frameworks based on a main loop.
      saying the number of breaks would be nice too:
      break
      break 2
      berak 3...

    • @TheDanielLivingston
      @TheDanielLivingston 5 ปีที่แล้ว

      Certain languages, like FORTRAN and Java, have ‘named loops’ which solve this problem
      www.tutorialdost.com/Java-Programming-Tutorial/11-Java-Labeled-Loop.aspx

  • @harshraj22_
    @harshraj22_ 4 ปีที่แล้ว

    Seriosly ? I expected some cool comprehension techniques.

  • @user-mb3mf2og9k
    @user-mb3mf2og9k 6 ปีที่แล้ว

    C loop is much better. Python rely on lot of internal functions, like __iter__, __next__,zip,enumerate....