Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

FIOC IS BROKEN

Name: Anonymous 2012-12-13 10:56

>>> 'string with no string formatting markers' % ['string']
'string with no string formatting markers'
>>> 'string with no string formatting markers' % ('string',)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: not all arguments converted during string formatting

FIOC IS BROKEN!

Name: Anonymous 2012-12-13 11:13

Read Evaluate Python Loop

Name: Anonymous 2012-12-13 11:16

This is kind of misleading, though:

>>> '%s and %s' % ['a', 'b']

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    '%s and %s' % ['a', 'b']
TypeError: not enough arguments for format string


Lists are a single argument to %, so they logically behave differently from tuples here. The point you really want to make is a % b not being equivalent to a % (b,).

Which is still broken, I guess. The lesson here is you shouldn't ever be using % on strings anymore; there's format for that now, and it's much more readable (and Pythonic!)

Name: Anonymous 2012-12-13 11:23

4chan.org/g/

Name: Anonymous 2012-12-13 11:25

>>3
That's not what I mean at all.

'string with no string formatting markers' % ['string'] should be raising an exception.

I understand that the list is a single argument to the string, but the string has no %s.

format returns the same result:
''.format(['a'])

Name: Anonymous 2012-12-13 11:28

RAISE MY ANUS

Name: Anonymous 2012-12-13 12:03

Python has thousands of little corner cases like this, if you actually tried to comprehend them all you would go crazy.

Name: Anonymous 2012-12-13 12:04

>>7
Can you tell me some other ones? I like them.

Name: Anonymous 2012-12-13 12:04

exceptionFactory

Name: Anonymous 2012-12-13 14:48

>>3
.format is shitty and I am going to use the named version of classical printf for the rest of my life.

By the named version I mean feeding it dicts like this:

"My other %(item)s is a %(joke)s" % dict(joke="cdr", item="car")

Name: Anonymous 2012-12-13 15:03

>>1
it was designed to be so

Name: Anonymous 2012-12-13 16:24

file a bug report and LE GUIDO can fix it for you

Name: Anonymous 2012-12-13 18:30

>>12
But, LE GUIDO doesn't read his SICP![1] And I bet you that he never read the copy that /prog/ mailed to him, either.

_____________________
[1] https://twitter.com/gvanrossum/status/1838308947

Name: Anonymous 2012-12-13 18:34

>>13
Was it really /anus/?

Name: Anonymous 2012-12-13 18:42

Name: Anonymous 2012-12-13 18:43

>>15
Oh, so that's where that bookmark comes from.

Name: Anonymous 2012-12-14 10:08

I know from a reliable source that the guido had torn the SICP in half, burned one half immediately in his fireplace and used the second half as toilet paper.

Name: Anonymous 2013-09-01 20:45



                _,,.. --─‐‐ァ
              ,.:'"   ,.:'"`ア´
             i    /  /   _,,.. --─‐ァ
             .,'   / /  / ,. --‐ァ'"
            /  /./  /  /  /
           ,..-,'  / ./‐- 、.,/ /  /
        ,. '´   | .//   /./  /
       .,.'     !/     ヽ/_/ヽ,
      /  / ,.:'´,  /  ;   ,'   ヽ.,`フ
      ,' .,' ./ / /!___ / !  /  !   Y
     .!  i ,'  ,' /_」__/` ! / i __/! i |
     |  !/  i ァ;´ ,r!`ヽ!/ ,! /`i. ',. '、  嘘じゃないと言うなら
     !  //i`レ'| ゝ-‐'     ァ'7ア':! ハr-ヽ
    .!  '  i, | | ''"      `' ./レ'ン'    私の目を見て話してください
    !   ,'! .! i、      ´ "人! |
    ,'   !/ ! | .! ,iヽ、  ´ ,..イ! |ヘ!
   ./   / ハ.,.|  !´\. `ニ'i´>、 | ! |',
  /   ,' _/イ:::',  ',ヽ. \__,レ' i:`!  | ',
  ,'   ァ'´::::`ヽ;::ヽ. ヽ,へ,/ムヽ!::| !.ト、!
  i  /7:::::::::::::::::::':;:::', ',、,/ i | i/:| /;:::':,
  ', / !::::::::::::::::::::::':、レ':::'ヽ. !イ::::レ':::i:::::::ヽ

Name: Anonymous 2013-09-01 22:16



      ',         ||         //      / ./
     ',       |  _,,,,.....,,,/_      //            ,.  '"
     ',     , '"´    r‐-、___`>、 /            ,.  '"
          /      _,,.. -─- 、..,,_ ヽ.       ,.  '"
  /´ ̄`ヽ<     , '"´        `ヽ}   ,.  '"
 /   ⌒ヽ(::::l))__,>'"´ ̄ ̄ ̄`"' ー- 、   \        /\
 |       ア´ /    、 /|   ,     \   } 、     /  /
 ヽ     `Y  ,'     /メ、|__/|    ,!   ヽ,ハ |  __/  /___
   ',    | /    /ァ' ⌒ヽ  ,'  / | |  !/ ./  /_       / - ─=
  ノ ヽ   | \__/ |7   ∩ く__/-/_./  |/    /  / ̄/  / _ _  />
, '´   |  ,'    ./  八   り       r!7|  /ハ    /_/  /  / /_/ /_///
!    ノ_ノ,   く__/|  `'ー      ヽY././ | ○     /_/    ∠/
'、  (   /   ヽ  ハ "   /´  ̄ ヽ  ト/ /    。  人       人
 ヽ.  ハ |へ、  ∧ | u  ,'  ̄`ヽ } ,ハ ,' o   )ー '"  `''ー--‐''"  `''ー
   \|´    \/レ' |/\  l_      /   } |   <
   ,..::'"´ア´ ̄ ̄Y| ̄\ > 、,_,,.イ∧_/ |     )  そんな事をすれば
. /::::::::/      、|}   \__/\ レ'  |  / \  く    川が汚染されるぞ!
/::::/こ>、    八、    /ム  ト、   //    \ )
::::/   ヽ/    /  \ /   \{ ,ハ ´       ⌒ヽr─-、  , -─- 、 , -─

Name: Anonymous 2013-11-30 8:22

░░░░░░░▄▀▀▀▀▀▀▀▀▀▀▄▄░░░░░░░░░
░░░░▄▀▀░░░░░░░░░░░░░▀▄░░░░░░░
░░▄▀░░░░░░░░░░░░░░░░░░▀▄░░░░░ YOU HAVE BEEN VISITED BY
░░█░░░░░░░░░░░░░░░░░░░░░▀▄░░░ LE 'FEEL OF NO GF
░▐▌░░░░░░░░▄▄▄▄▄▄▄░░░░░░░▐▌░░
░█░░░░░░░░░░░▄▄▄▄░░▀▀▀▀▀░░█░░ A qt 3.14 gf will come to you,
▐▌░░░░░░░▀▀▀▀░░░░░▀▀▀▀▀░░░▐▌░ but ONLY if you post a
█░░░░░░░░░▄▄▀▀▀▀▀░░░░▀▀▀▀▄░█░ `>tfw no GF on this thread
█░░░░░░░░░░░░░░░░▀░░░▐░░░░░▐▌
▐▌░░░░░░░░░▐██▀█▄░░░░░░█▀█░▐▌
░█░░░░░░░░░░░▀▀▀░░░░░░▀▀▀▀░▀▄
░▐▌░░░░▄░░░░░░░░░░░░░▌░░░░░░█
░░▐▌░░▐░░░░░░░░░░░░░░▀▄░░░░░█
░░░█░░░▌░░░░░░░░▐▀░░░░▄▀░░░▐▌
░░░▐▌░░▀▄░░░░░░░░▀░▀░▀▀░░░▄▀░
░░░▐▌░░▐▀▄░░░░░░░░░░░░░░░░█░░
░░░▐▌░░░▌░▀▄░░░░▀▀▀▀▀▀░░░█░░░
░░░█░░░▀░░░░▀▄░░░░░░░░░░▄▀░░░
░░▐▌░░░░░░░░░░▀▄░░░░░░▄▀░░░░░
░▄▀░░░▄▀░░░░░░░░▀▀▀▀█▀░░░░░░░

Name: Anonymous 2013-11-30 20:16

/
███████ ]▄▄▄▄▄▄▄▄ Bob is building an army.
▂▄▅█████████▅▄▃▂ Bob and his tank are against Google+
Il███████████████████]. Copy and Paste this all over
◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤.. Youtube if you are with us

Don't change these.
Name: Email:
Entire Thread Thread List