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 514741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:33:22+00:00 2026-05-13T07:33:22+00:00

def validate(request, *args, **kwargs): form_class = kwargs.pop(‘form_class’) extra_args_func = kwargs.pop(‘callback’, lambda request, *args, **kwargs:

  • 0
def validate(request, *args, **kwargs):
    form_class = kwargs.pop('form_class')
    extra_args_func = kwargs.pop('callback', lambda request, *args, **kwargs: {})

thanks


a={'a':'aaa','b':'bbb'}
b=a.pop('a',lambda x,y:x)
print a

i know dict.pop(‘a’),but i don’t know dict.pop(‘a’,func)
what is the use of ‘func‘ in here

  • 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-13T07:33:23+00:00Added an answer on May 13, 2026 at 7:33 am

    The expression:

    lambda request, *args, **kwargs: {}
    

    builds an anonymous function which must be called with at least one argument (which, if named, must be named request) and can be called with any number of positional and named arguments: when called, it ignores all the arguments and returns a new empty dictionary.

    The code snippet:

    a={'a':'aaa','b':'bbb'}
    b=a.pop('a',lambda x,y:x)
    print a
    

    prints {'b': 'bbb'} (which is also the value a stays bound this after the snippet executes) and bings the string 'aaa' to name b. The second argument to the .pop method plays no role in this case: it’s only used when the first argument is not found as a key in the dictionary on which the method is called (in which case, .pop‘s second argument would be the “default value” returned by the call to .pop, without any alteration to the dictionary). In this case, 'a' is indeed found at that time as a key in dictionary a, and therefore it’s removed from that dictionary, and the corresponding value, string 'aaa', is returned by the call to .pop (whence it gets then bound to name b).

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

Sidebar

Ask A Question

Stats

  • Questions 305k
  • Answers 306k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Three20 provides a sample app that does exactly this. Check… May 13, 2026 at 9:10 pm
  • Editorial Team
    Editorial Team added an answer it acts as a hashmap. in fact, every ActionScript object… May 13, 2026 at 9:10 pm
  • Editorial Team
    Editorial Team added an answer without looking into all of your code, at execution plans,… May 13, 2026 at 9:10 pm

Related Questions

I am trying to save a modelform that represents a bank account but I
In a Django form, how do I make a field read-only (or disabled)? When
I'm playing with the authlogic-example-app and I'm failing to get the email address from
now im learning to validate form, all is working, im showing the erros of
I am providing a web service to be called by external companies. The required

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.