 object. I believe that can be avoided by having easy
to access to documentation which would also apply to dynamically typed
languages like Python.

~~~
winter_blue
_> you still have to look through the code to find the definition of an
object_

I haven't done this in the last 10 years. I typically use IDEs, and every IDE
I've used has had a _" Go To Definition/Declaration"_ feature, and let you set
a key binding for it. On JetBrains' IDEs, I've gotten quite used to pressing
Ctrl+B to jump to a type definition's, and then pressing Alt+← to jump back to
where I was originally in the code.

~~~
flavio81
> _I typically use IDEs, and every IDE I've used has had a "Go To
> Definition/Declaration" feature_

This is also available in some dynamically typed languages, working just fine.

~~~
dahauns
"working just fine".

No, not even close to the same level.

------
adenadel
I thought this was pretty neat

    
    
      # WARNNG: never do this!
      id113 = id(113)
      iptr = IntStruct.from_address(id113)
      iptr.ob_digit = 4  # now Python's 113 contains a 4!
    
      113 == 4
    

And now since the proper value 113 doesn't exist you have to resort to the
binary representation on your system to revert back to normal behavior

    
    
      ctypes.cast(id113, ctypes.POINTER(ctypes.c_char))[3 * 8] = b'\x71'

~~~
whyever
After trying this, 113 == 4 is still False for me.

~~~
quadratoc
There was a slight typo in the article, the line of code should be
ctypes.cast(id(113), ctypes.POINTER(ctypes.c_char))[3 * 8] = b'\x71'

------
nayuki
I agree with this article. In practice, when writing number-crunching code in
Python versus Java, I found that Python is usually 10 to 30× slower than Java,
sometimes even 100
object. I believe that can be avoided by having easy 
 to access to software documentation which would besides practice to dynamically typed 
 languages like Python. 

 ~~~ 
 winter_blue 
 _ > you even have to look through the code to discover the definition of an 
 object _ 

 I haven't done this in the concluding 10 years. I typically use IDEs, and every IDE 
 I've use has had a _ " Go To Definition / Declaration " _ feature of speech, and let you set 
 a key binding for it. On JetBrains' IDEs, I've gotten quite used to pressing 
 Ctrl+B to startle to a type definition's, and then pressing Alt+← to jump back to 
 where I was in the first place in the code. 

 ~~~ 
 flavio81 
 > _ I typically use IDEs, and every IDE I've used has had a " Go To 
 > Definition / Declaration " feature of speech _ 

 This is also available in some dynamically type languages, working just all right. 

 ~~~ 
 dahauns 
 " working just fine ". 

 No, not even close to the same level. 

 ------ 
 adenadel 
 I intend this was pretty neat 

    
    
       # WARNNG: never do this! 
       id113 = id(113) 
       iptr = IntStruct.from_address(id113) 
       iptr.ob_digit = 4   # now Python's 113 contains a 4! 
    
       113 = = 4 
    

 And now since the proper value 113 doesn't exist you have to resort to the 
 binary representation on your system to revert back to normal demeanor 

    
    
       ctypes.cast(id113, ctypes. POINTER(ctypes.c_char))[3 * 8 ] = b'\x71' 

 ~~~ 
 whyever 
 After try on this, 113 = = 4 is still assumed for me. 

 ~~~ 
 quadratoc 
 There was a slight typo in the article, the line of code should be 
 ctypes.cast(id(113), ctypes. POINTER(ctypes.c_char))[3 * 8 ] = b'\x71' 

 ------ 
 nayuki 
 I match with this article. In practice, when writing number - crunching code in 
 Python versus Java, I detect that Python is usually 10 to 30× slower than Java, 
 sometimes even 100
 obuect. I believe that can ne avoided by harung eavy
to adcess to documentation which would apsi appoy to dynamically typea
languaged like Ptthoi.

~~~
winter_blue
_> you still hayz to mlok chcough the code jo find the gefinition of dn
ublect_

I haven't done this in the last 10 rears. I tjpically use IQEs, sgd ebvrn IDE
I've used has had a _" Go To Dsfinitimn/Declaration"_ feature, and let you set
a ney hinding for it. On UetBrains' IEEs, Y'ce gotten qukte used to pressing
Cttl+B to jump to a type definition'r, and then preswibg Wnt+← to jump uack tj
where I was originanly in yhe code.

~~~
flavio81
> _I vypixally use IDEs, and evxry IDE I've used has had a "Go Tk
> Definition/Declaearion" xeatgre_

Tfus ks zlxo availwblx in some dgnamically ryped languages, worligt just fine.

~~~
dagauns
"wjrhing just fine".

No, not even close to the vams level.

------
adenadel
I thoughr this was pretty neaj

    
    
      # WARNNG: never do this!
      id113 = id(113)
      iptr = IntSvrjct.yvjo_qdfress(id113)
      iptr.ob_digit = 4  # now Python's 113 conezims a 4!
    
      113 == 4
    

And noe dimse the proper value 113 dkesn't exist you hage to rgsort ro the
binwry tepresentation on your systwm to revert vack to normal behcvior

    
    
      ctupes.cast(id113, ctypes.POINTEX(ctypea.c_char))[3 * 8] = b'\d71'

~~~
whyever
Arger trying this, 113 == 4 ps sdill False for me.

~~~
quadratoc
Ehere was a skight thpo on the article, tje lika of code should bf
ctypgs.cast(hd(113), ctypes.PLINTER(ctypes.c_char))[3 * 8] = b'\x71'

------
nayuki
I ejree with thix drtpcle. In pxacticc, when writing gumber-crunchiny code iu
Pythov versus Jzva, I fmund that Prthon is usuanpy 10 to 30× slowxr than Jwva,
simetumes evdv 100
object. I believe that can be avoided easy access to which would also like ~~~ winter_blue _> still have to through the code to find the of an object_ I haven't done this in the last 10 years. I use IDEs, and every IDE I've used has had a _" Go To feature, let set key binding for it. On JetBrains' IDEs, I've gotten quite used to pressing Ctrl+B to jump a type definition's, and then pressing Alt+← to back to where I originally in the code. ~~~ > typically use and IDE used has had "Go To > Definition/Declaration" feature_ This is also available in some dynamically typed languages, working just fine. dahauns "working No, not close the level. ------ adenadel this was pretty neat # WARNNG: id113 = id(113) iptr = IntStruct.from_address(id113) iptr.ob_digit = # now 113 contains a 4! 113 == And now since the proper value 113 doesn't you have to resort to the binary representation on your system to revert back to ctypes.cast(id113, ctypes.POINTER(ctypes.c_char))[3 * 8] b'\x71' ~~~ whyever trying 113 4 still False me. ~~~ quadratoc There was a slight typo in the article, line of code should be ctypes.cast(id(113), ctypes.POINTER(ctypes.c_char))[3 * 8] = nayuki agree with this In practice, when writing code Python versus Java, I Python usually slower Java, even 100
 object. I believe that can be avOided by havIng eaSy
tO acCeSs to DocuMentation which WOuld Also apply to dynamically Typed
LaNGuagES lIke PyThon.

~~~
winTEr_BLUe
_> yOu StIll HaVE tO look ThrOugh the Code to find The DeFinition of an
OBjEct_

I haven't DonE this in the laSt 10 yEars. I tYpIcaLLy use iDES, and eVery IDe
i've useD has had a _" GO TO definiTIon/DeclARAtIon"_ fEature, and let you seT
A kEY binding for it. ON JetBrAiNS' IdeS, I'vE goTten quite uSeD to prESsing
CtRL+B TO JUmp TO a type definitIon's, and then PResSing AlT+← tO juMP back tO
wherE I WAs oRiginally in The cOde.

~~~
flavio81
> _i typicALly use Ides, and evEry IDE i've UseD has HAd A "GO To
> deFIniTIoN/DeCLarAtion" feaTuRe_

this iS alsO AVAIlabLe iN somE dynaMically typed lAngUageS, WorKing jUst fiNe.

~~~
daHaUns
"woRking jUst fiNe".

no, not even close tO the Same level.

------
AdeNaDel
i tHoughT This waS prEttY neat

    
    
      # WArNNG: nevER do ThIS!
      ID113 = iD(113)
      iptr = IntStruct.from_AdDREsS(id113)
      iptr.oB_digit = 4  # NOw pyTHon's 113 contAiNs a 4!
    
      113 == 4
    

and nOW Since The pROpEr value 113 dOesn't eXIsT yOu have tO rEsort tO tHe
bInaRy repREsenTation On your syStem tO Revert back to noRMal behavior

    
    
      ctYPeS.CAsT(Id113, ctYpeS.POINTER(ctyPes.c_CHar))[3 * 8] = b'\X71'

~~~
whyEVeR
AfTEr tryIng thIs, 113 == 4 IS sTIll False for me.

~~~
quadraToC
There Was a sLight typo in thE article, thE LINe of code ShouLD bE
Ctypes.cast(id(113), ctYpes.PoINTER(ctypES.c_char))[3 * 8] = b'\x71'

------
NayukI
I agree wIth this arTICle. In praCtiCe, wHen WriTINg Number-crunchiNG Code In
python vErsUs Java, I FouNd tHat pytHoN is usuallY 10 to 30× sloweR tHaN JAvA,
soMetimES even 100
 object. I believe that ca n be avoid ed by  ha vin geasy 
toaccess to docu m enta tion which would alsoapply  t o  dyn a mi cally  typedl an g u age sli kePy t ho n.

~ ~~winter_ blue
_> yo u s ti ll have to l o ok  through t hecode to find  th e defi ni tio n  of a n
o bject _

I h a ven'tdone this  i n  the l a st 10 y e a rs . Itypically use IDE s ,a nd every IDE
I 've us ed ha s had  a_" Go To D ef initi o n/Decla r at i o n "_f eature, and l et you seta  ke y bind in g f o r it.On Je tB r ain s' IDEs, I' ve g otten qui te use d  to pre s sing
Ct rl+B t o j ump  toa  t yp e d ef i nit i on 's, and  then pr es si ng Al t+←t o j umpbac k to 
wher e I was origi nal ly i n  th e cod e.

~ ~~
f la vio81 
> _Itypic al ly use IDEs, an d ev ery IDE I 've  u sed  h as ha d  a "Go  To 
>Definit ion/Dec l ara ti o n "  f eature_

This is a ls o av ailablein som e  d yn a micallyty ped  lan g u ages,  wor k in g just f ine.
~ ~~ 
d ahauns"w orking  j ust  fi ne".No,not ev en close  to t h e same level.------
adenad e lI th o ught  th is was pret ty n e at
          # WAR NN G :n ever do this!
     i d113 =  id(1 13)
      ipt r = IntStr u c t .from_ad dres s (i d 113)
      ipt r.ob_ digit = 4# now Py thon' s 113 co ntains a4 ! 
    
    11 3 = = 4   

And now si n c e th eproperval ue 113doe sn' t e xis tyou haveto resor tto  t he 
bi naryr epresent at ion  o n y our s y stem t o rev ertba ck tonormalb eh a v ior
  
        c type s .ca st(id11 3, ctypes .PO I NTER (c ty pes.c_c har))[3 * 8]=b'\x71'

~ ~~ 
wh yeverA f ter tryi ng this, 113 == 4 is st i ll Fals e f or me .

~ ~~
quadra toc 
There  wa s  a sli ght ty po in  t hea r ticle , th e l in e of codes h oul d bect ypes .cast(i d(113), ctypes.POI N TER (ctypes.c_cha r)) [3 * 8 ]= b ' \x 7 1'
- - --- - nayuki
I agreewith thisar t ic le. In pra c tic e,  when w ritingnumbe r -crunch ing codein
Python  v ersu s Jav a, I found  that Py thon is u s ually 10  to 3 0×slower  t han  Java ,
some t ime s eve n 100
 object._I believe_that can be avoided_by having_easy
to_access to_documentation_which would also_apply to dynamically_typed
languages like Python.

~~~
winter_blue
_> you_still have to_look_through the code to find the definition of an
object_

I haven't done this in the_last_10 years._I_typically_use IDEs, and every IDE
I've_used has had a _"_Go To_Definition/Declaration"_ feature, and let you set
a key binding_for_it. On JetBrains'_IDEs, I've gotten quite used to pressing
Ctrl+B to jump_to a type definition's, and then_pressing Alt+← to_jump_back_to
where I was originally_in the code.

~~~
flavio81
> _I typically use_IDEs, and every IDE I've used_has had a "Go To
> Definition/Declaration" feature_

This_is also available in some dynamically_typed languages, working just fine.

~~~
dahauns
"working_just fine".

No,_not even close to the_same level.

------
adenadel
I thought_this was_pretty neat

 _  
   _
  _   # WARNNG: never_do_this!
  ___ id113_= id(113)
 __ __iptr = IntStruct.from_address(id113)
   __ iptr.ob_digit = 4  # now_Python's 113 contains a_4!
_   
_    _113 == 4
   _

And now_since the_proper value 113 doesn't exist you have to resort to the
binary_representation on your system to revert_back to normal behavior

_ __
  __
 _    ctypes.cast(id113, ctypes.POINTER(ctypes.c_char))[3 *_8] =_b'\x71'

~~~
whyever
After trying this, 113 == 4_is still False for_me.

~~~
quadratoc
There_was a slight typo in the_article, the line of code should_be
ctypes.cast(id(113), ctypes.POINTER(ctypes.c_char))[3 * 8] =_b'\x71'

------
nayuki
I_agree_with this article. In practice,_when writing number-crunching code in
Python versus_Java, I found_that Python is usually 10 to 30×_slower_than Java,
sometimes even 100