Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6534143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:12:55+00:00 2026-05-25T10:12:55+00:00

I just got through tracking down a random bug while using Twisted: Traceback (most

  • 0

I just got through tracking down a random bug while using Twisted:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 826, in proto_message
    self._recvMessage(self.localObjectForID, requestID, objectID, message, answerRequired, netArgs, netKw)
  File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 840, in _recvMessage
    netResult = object.remoteMessageReceived(self, message, netArgs, netKw)
  File "/usr/lib/python2.7/dist-packages/twisted/spread/flavors.py", line 114, in remoteMessageReceived
    state = method(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1141, in unwindGenerator
    return _inlineCallbacks(None, f(*args, **kwargs), Deferred())
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1020, in _inlineCallbacks
    result = g.send(result)
exceptions.AttributeError: 'NoneType' object has no attribute 'send'

This was caused by:

@defer.inlineCallbacks
def myfunc():
    # Function implementation with no yield statement.

And when the myfunc was called, I would get the previous traceback printed but with everything within the function working properly. This is because it returned None instead a generator when called, which defer.inlineCallbacks expects to be returned. Is there way to declare a function a generator without placing a yield statement within the function body? Such as a generator decorator?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:12:56+00:00Added an answer on May 25, 2026 at 10:12 am

    As others have noted, this likely makes no sense. But for completeness and to answer the question:

    No, you have to use a yield to make it a generator, except of course if you create a decorator that’s a generator (by including the yield keyword) itself but doesn’t actually yield anything and just calls the decorated function. Such a yield can be unreachable and pointless (if False: yield), but it has to be there. As this isn’t a common need, there is nothing like the latter pre-built, at least nothing I’m aware of. The by far simplest way is to just add this to your function, writing your own decorator isn’t worth it for a few cases and should you need it frequently, there’s probably something wrong without your design and you should fix that instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just got through manually removing the bin\ and obj\ folders from around 30
I just got done working through the Django tutorials for the second time, and
Just got a question about generics, why doesn't this compile when using a generic
I am reading The Java Tutorial (for the 2nd time). I just got through
I've got this odd problem. If I make a call on that function through
Just got a request from my boss for an application I'm working on. Basically
I just got Delphi 2009 and have previously read some articles about modifications that
I just got a dedicated server from a hosting company, and for some reason,
I just got a shiny, brand-new Debian server handed to me by our Systems
I just got my azure invitation code...yay! Are there any official samples for windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.