Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
¿Qué es el "objeto generador" en Django?
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Un objeto generador en python es algo así como una lista perezosa. Los elementos solo se evalúan tan pronto como itera sobre ellos. (Por lo tanto, la lista de llamadas los evalúa a todos).

Por ejemplo puedes hacer:

>>> def f(x):
...  print "yay!"
...  return 2 * x
>>> g = (f(i) for i in xrange(3))    # generator comprehension syntax
>>> g
<generator object <genexpr> at 0x37b6c0>

>>> for j in g: print j
... 
yay!
0
yay!
2
yay!
4

Vea cómo f se evalúa solo a medida que itera sobre él. Puede encontrar excelente material sobre el tema aquí: http://www.dabeaz.com/generators/

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!